What is 'partial' from a coding perspective? - partial

I'm currently working through a geddy tutorial and came across a line of code:
<%- partial('form', {step: {}, toDos: toDos}) %>
What does partial mean? I've done a google search without much insight. I'm guessing it means that you partially load the content so the page loads faster?
Any explanations or helpful links would be appreciated.
http://geddyjs.org/tutorial
It's been a while since I've coded so if I should be looking at a particular method of coding (e.g. OOP, MVC) that I'm missing let me know.

I received this answer by Dan Craciun on experts exchange which answers it for me:
In geddy, a partial (denoted by a _ in front of the name) is a reusable file/template, that is meant to be used in more than one template. It helps share code between different templates.
See here for a longer explanation (about half page, "An intro to partials"): http://code.tutsplus.com/tutorials/creating-a-todo-list-app-with-nodejs-and-geddy--net-24535
HTH,
Dan

I am not sure, but in Symfony - partials are used in case that you have the some template, but there is a part that may be changed later (for example if you have the heading part of your html page, but the title will be different depending on what type of page it is).
So in order to keep the entire template and not break it into 2 parts, there are partials.

Related

!DOCTYPES the document type definition in more detail

I am researching this in detail and just need more specific answers on the various parts of a !DOCTYPE.
In particular I would like a thorough break down of the parts of a !DOCTYPE that is strict.
I understand that there are various !DOCTYPES and I would like to know what every part of the declaration means as it is broken down into its various parts and this will help me move on with my research.
!DOCTYPE html PUBLIC (let's start here)
I understand that a doctype is the first thing you should see declared at the top of an html page in the code and that this tells the browser how to display your code.
Then we come to html:
Explaining that this is a hyper text mark-up language being used
'PUBLIC' what is this referring to exactly could you help me with this?

Include vanilla file in Wicket?

It would be useful to be able to include some vanilla text files, containing simple scripts (with no HTML-relevant content), in an HTML page in my Wicket portal. There's no end to support for .css and .js, but I would just like to drop simple text inside a
<pre>
...
</pre>
paragraph so that I don't have to keep copying and pasting when these change. Or, am I in too much of a hurry and have asked the wrong question?
Profuse thanks for any and all comments.
Later, ...
The answer I got triggered it for me. It was just what I needed. Unfamiliar as I am with Wicket, this was pretty much over my head. However, thanks to the marvel of Google and a more knowledgeable friend, I was able to get this going. A pretty thorough description of my complete solution can be found at http://www.javahotchocolate.com/notes/wicket.html. Thanks to Nicktar!
Just give your pre-tag a wicket-id and fill it with a Label, setting EscapeModelStrings to false for the Label...

How to define custom wicket tag

I could not find a wicket tag like wicket:include? Can anyone suggest me anything? I want to include/inject raw source into html files? If there is no such utility, any suggestions to develop it?
update
i am looking for sth like jsp:include. this inclusion is expected to be handled on the server side.
To do this, you'll need to implement your own IComponentResolver.
This blog article shows an example somewhat resembling what you're after.
Is it raw markup that you want to include, or Wicket content?
If it's raw markup, even a simple Label can do that for you. If you call setEscapeModelStrings( false), the string value of the model will be copied straight in the markup. (Watch out for potential XSS attacks though.)
"Including" Wicket markup is done via Panels (or occasionally Fragments)
Update: If you add more detail about the actual problem you need to solve, there's a good chance that we can find a more "wickety" solution, after all, JSP and Wicket are two different worlds and the mindset of one doesn't work very well in the other.

Google Rich Snippets warnings for hCard

I get the following errors from the Google Rich Snippet Tool for my website http://iancrowther.co.uk/
hcard
Warning: This information will not appear as a rich snippet in search results results, because it seems to describe an organization. Google does not currently display organization information in rich snippets
Warning: At least one field must be set for Hcard.
Warning: Missing required field "name (fn)".
Im experimenting with vcard and Schema.org and am wondering if I'm missing something or the validator is playing up. I have added vcard and Schema.org markup to the body which may be causing confusion. Also, I am making the assumption I can use both methods to markup my code.
Update:
I guess with the body tag, I'm just trying to let Google discover the elements which make up the schema object within the page. I'm not sure if this is a good / bad way to approach things? However it lets my markup be free of specific blocks of markup. I guess this is open to discussion but I like the idea of having a natural flow to the content that's decorated in the background. Do you think there is any negative impact? I'm undecided.
I am in favour of the Person structure, this was a good call as this is more representative of the current site content. I am a freelance developer and as such use this page as my Organisation landing page, so I guess I have to make a stronger decision of the sites goals and tailor the content accordingly, ie Organisation or Person.
I understand that there is no immediate rich snippet gains, but im a web guy so have a keen interest in these kind of things.
With schema testing, I find it easiest to start from the most obvious problem, and try to work our way deeper from there. Note, I have zero experience with hcard, but I don't believe the error you mentioned actually has anything to do with your hcard properties.
The most obvious problem I see, is that your body tag has an itemtype of schema.org\Organization. When you set an itemtype on a dom element, you are saying that everything inside of that element is going to help describe that itemtype. Since you've placed this on your body element, you are quite literally telling Google that your entire page is about an organization.
From the content of your page, I would recommend changing that itemtype to schema.org\Person. This would seem to be a more accurate description. Once you make that change and run the scanner again, you may see more errors relating to the schema and we can work through those too (for example, you'll probably need to set familname and givenName).
With all of that said, you should know that currently there are no rich snippets that you will gain from adding this schema data. Properly setting this up on your page, is only good to do, especially since we don't know what rich snippets Google or others will expose in the future, but currently you won't see any additional rich snippets in Google search results from adding these tags. I don't want to discourage you from setting this up properly but I just want to set your expectations.

how to create a simple web form in scala/lift

I need to create a from in lift with username and phone number.
can someone give a full example how to create a simple form in lift that can be submitted? or a reference to a good one. all examples I have seen are not full or has too many options for me, and I couldn't manage to compile them.
Thanks,
Ohad.
You can find an excellent, simple example in the introductory course given by David Pollak in London here. The snippet for the simple form (instead of a phone number as you comment it has an age) is here. The html associated is this one, just comment the Lift Screen section and uncomment the simple form.
Please also note that Lift has a very active and willing to help community, so you can also ask these questions in the Lift mail list.