When I use tag on my .html page to reduce my code visibility in Meteor app development. Instead of showing data of that correspondent template, it shows the name of the template..
For eg:
{{>season}}
<template name="season">
<ul><li>Summer</li></ul>
</template>
.. But unfortunately in output window it appears as {{> season}}
Maybe you did not startup your project.
You need to do this in console:
cd yourappname
meteor
I suggest you follow this tutorial to know how to startup your project:
https://www.meteor.com/try
Related
Hello All,
<div id="Main">
Admin Home
View Logging
View Cache
View Sessions
Admin Logout
</div>
Now I have the above code in my jsp file. If I try to locate the jspx files in my source code, I do not see them. Please help me by directing me on where can I find them.
FYI I am using struts 1.x, Velocity. Please let me know If I need to add more details.
If you want to search in files: Ctrl+H and then choose tab File Search.
If you want to search for resources: Ctrl+Shift+R.
If you want to search for Java types: Ctrl+Shift+T.
If you want more shortcut keys: Ctrl+Shift+L.
Also at this link you can find a list of all eclipse shortcuts
I found at this link a part of this solution
I am using the meteor package IRLibLoader. It works great loading all of my external JS. I am able to call all of the JS functions from dev console to confirm that they are actually available. The problem... all of the DOM elements , for example div tags with id = foo.... I am unable to select any of them , they are all coming up undefined. The page is getting stuck to loading. Any ideas?
I ended up over complicating my issue.
The simple solution was for me to add the MyProject/public folder to my Meteor application.
For example:
MyProject/public/images/foo.jpg
I was then able to serve the content via the public folder and when any of my app needed access i would just put for example :
I've got a very simple template problem going on that appears to be similar to this guy's problem, though I've tried to build a simple example to demonstrate the problem and hopefully have someone explain to me how to fix or work around it.
Although as I'm doing some online research, it may be that the official documentation is out of date with the code. The reason I haven't bought into accepting that just yet is that the problem seems to have existed for a while, the dates on such articles in forums appears to be fairly old, and there's talk of it being fixed. There's also talk the feature is gone. What's the new way, if there is one?
I'm using Meteor 0.9.0.1 with iron:router 0.9.1. Specifically, I set up my project like this:
$ meteor create ironTest
$ cd ironTest
$ meteor add iron:router
$ meteor
Pointing my browser at http://localhost:3000/ as instructed, shows the default project. So far so good.
Now make ironTest.html contain this:
<body>
<h1>Before</h1>
{{renderRouter}}
<h2>Afterward</h2>
</body>
<template name="hello">
Hello Template
</template>
<template name="goodbye">
Goodbye Template
</template>
Make ironTest.js contain this:
Router.configure({
autoRender: true // we will experiment with this Boolean shortly
});
Router.map(function () {
this.route('hello');
this.route('goodbye');
});
If you go to the routes http://localhost:3000/hello and http://localhost:3000/goodbye, you'll see the templates correctly render as expected and documented, appended to the <body> element, so it appears after the <h2> element.
According to the current documentation for iron:router, one should be able to set the autoRender property to false, and the template should no longer be appended to the <body> element, but rather be injected where the Handlebars (okay, Spacebars) element {{renderRouter}} is, that is, between the <h1> and <h2> elements.
When I try this, visually it doesn't do anything. Opening a JavaScript Console to look at errors shows none. Although, by deliberately going to an invalid route it will show a missing template router exception, showing the routing code is indeed working.
Does anyone know how to coerce the code above into working?
For the curious, I've got a working simplistic equivalent that might be of use to others working this problem.
This new ironTest.html uses a template (for a layout) with no <body>:
<template name="main">
<h1>Before</h1>
{{> yield}}
<h2>Afterward</h2>
</template>
<template name="hello">
Hello Template
</template>
<template name="goodbye">
Goodbye Template
</template>
This ironTest.js instead uses a layout:
Router.configure({
layoutTemplate : 'main'
});
Router.map(function () {
this.route('hello');
this.route('goodbye');
});
It's worth an aside that this solution doesn't work for me, as I don't want a global layout, and have concern that riddling layouts in the route themselves is a tighter coupling than desired for my purposes.
I'm currently looking for a way to dump debugging log information from the Router as it performs transitions, but that's another story.
I want to use a script on my web site and I know that I must put all scripts separated from the template in a .js file. But I don't know how to do it this time when the script is executed directly in the script src:
<script type="text/javascript" src="http://svenskfotboll.se/widget.aspx?scr=table&ftid=39662&b1=%23006bb7&f1=%23ffffff&b2=%23bfd4f3&f2=%23000000&b3=%23ffffff&f3=%23000000&b4=%23ececec&bo=%23ffffff&s=1"></script>
What is the best practice to get it to work in Meteor?
I'd go to that url, get that script, and save it in a file in your project. However, there wasn't anything actually at that url when I just checked it out. That would definitely be a problem too :)
EDIT: You can also stick in the head tag.
EDIT 2: if you want it to display in a template, like if it's a widget such as yours, you can insert it manually every time the template re-renders. It's pretty simple, actually. First we've got the template code:
Template.myWidget.rendered = function () {
$('#my-widget').html('<script src="src-here.js"></script');
}
And then the actual template:
<template name="myWidget">
<div id="my-widget">Loading...</div>
</template>
Finally, wherever you want the widget to appear in your html, just insert {{>myWidget}}
Use jQuery.getScript(): http://api.jquery.com/jquery.getscript/
In your case:
$.getScript( "http://svenskfotboll.se/widget.aspx?scr=table&ftid=39662&b1=%23006bb7&f1=%23ffffff&b2=%23bfd4f3&f2=%23000000&b3=%23ffffff&f3=%23000000&b4=%23ececec&bo=%23ffffff&s=1" );
You can also specify callback for success or failure (please see documentation linked above).
The following is my current code,
https://github.com/daslicht/kiss
After cloning it to my server I have added the spiderable package
and added phantomjs to the $PATH.
The basic structure of my app is essentially a Master Details layout,
on the left we have a list of headlines(Master)
and on the right the according details to each Headline.
So far so good..., when I call one page with:
http://78.47.126.11:3000/?_escaped_fragment_=blog/SbZayHyqKmZhCEHme/1
I get my Headlines displayed but not the according Details.
Do you have any idea what could be going wrong ?
Currently it is running as bundle with forever.
Best Regards
Marc
If think the Spiderable package won't show stuff from MongoDB, only static template-stuff.
So in this example only the static stuff will show, not the DB-loop:
<template name="main">
{{> thisWillBeOutputted}}
</template>
<template name="thisWillBeOutputted">
<h1>This will be displayed, sweet!</h1>
{{#each thisLoopFetchesStuffFromDBAndWontShow}}
<!-- stuff in this loop won't be displayed :( -->
<p>Something which won't be displayed: {{dbDoc.something}}</p>
{{/each}}
</template>
To summarize (what I believe is correct):
The Spiderable package better than not displaying anything for bots (which is the case with vanilla-meteor), but it's not as good as a good-old-PHP/whatever-site.
EDIT
I misunderstood your problem. What I would do is add <meta name="fragment" content="!"> to your head instead of going with the escaped-fragment thing. More here: https://developers.google.com/webmasters/ajax-crawling/docs/getting-started
I'm still pretty sure your DB-stuff won't get picked up by Google though. But I could be wrong!
If I understood, your app is ignoring 'blog/SbZayHyqKmZhCEHme/1'.
The error is because:
https://github.com/meteor/meteor/issues/487
The spiderable package does not currently reattach the escaped
fragment back onto the url sent to phantomjs, so it's not possible for
the page to display the correct content.
For example if googlebot encounters a url:
http://domain.com/#!page
It will make a request from the server:
http://domain.com/?_escaped_fragment_=page
However at the moment, the spiderable package will call phantomjs with
the following url:
http://domain.com/
My solution is to create your own spiderable package with fix by 'https://gist.github.com/4096777'