Matching of data files to pages - assemble

I have used the assemble/boilerplate-site as a test bed. Following the examples on http://assemble.io/docs/Data.html I have created a page named test.hbs and a data file named test.yml.
The yaml file contains:
title: stuff
when running grunt assemble, a test.html page is assembled into the destination directory. if my test.hbs contains the tag {{title}} the title is not added from the data file, however a tag of {{test.title}} does add the title from the data file.
on the docs page http://assemble.io/docs/options-data.html it states:
When using "external" data files (versus YAML front matter), if name of the data file is the same as the associated template then Assemble will automatically associate the two files.
I also need to use the {{title}} tag in my layout. This works if I use YFM at the top of the page rather than an external data file.
Am I misunderstanding how external data files are associated with a page or am I missing something?

You can use {{page.title}} in your test.hbs and layout.hbs files to access the variable without having to specify the actual page name.

Related

TYPO3: Where can I find the template created in the backend?

I'm trying to create separate templates for webpages with either a single or a double column structure. Currently my webpage only has one template, placed on the root page which is used by all its subpages.
However, I cannot find the template in myextension/Resources/Private/Templates as this folder is empty. Where is the template located in my extension and where should I add the alternative template?
I assume you use "fluid_styled_template"? Then the templates are in that respective core directory, in "Resources/Private".
If you want to manipulate them, copy them to your sitePackage into "Resources/Private/Extension/fluid_styled_content" (that at least is one of the recommended ways where to place it) and override the TypoScript that "fluid_stlyed_content" provides.
templateis not unique in TYPO3 context. we have:
typoscript records, maybe also as files which are included in a record or by PHP
HTML files, which are define a markup for parts of the website
they can be differed in
Marker-Templated. The old and less and less used kind with markers and subparts as placeholders for data defined in typoscript
Fluid templates. The modern kind with control structures and data objects
with the statemant
my webpage only has one template, placed on the root page
it is not clear what you mean:
records are defined in pages -> typoscript templates
maybe you mean in the root page a template is selected. that could mean HTML templates, probably fluid templates as the path myextension/Resources/Private/Templates matches the usual structure for fluid templates.
assuming fluid templates:
Templates are search in a list of folders. This list is managed in typoscript.
Any usage has it's own list and the list of your main/page template probably is at page.10.templatePaths. You can look for it in the TSOB (Typoscript Object browser)
If the list consists of one entry only you have only the basic config.
As the list of folders is consulted each time a template (,partial, layout) is accessed and only that file with matching name in the folder with highest priority is taken you can add your folders with higher numbers in the list so you do not need to change the original files (use copies in your folder to modify) or add files to the original folder (inside of other extensions).
So you need two things:
create your template file in an appropriate folder
(ext:myextension/Resources/Private/Templates sounds good)
and add this folder to the list of folders for these templates
(e.g. page.10.templatePaths.20 = EXT:myextension/Resources/Private/Templates)

Does the testandtarget.js file have a purpose?

While analyzing some requests on our dispatcher, we noticed that we continually get a 0 byte file generated from hitting the following path
/etc/clientlibs/foundation/testandtarget
This file is a ClientLibraryFolder. Its js.txt defines the base file as such:
#base=source
There is no "source" folder that is a direct child of testandtarget. The testandtarget folder contains two ClientLibraryFolders, mbox and util. The js in these folders is loaded on the page just fine. This is why Test&Target still works. However, the testandtarget ClientLib seems to be wrong by default (this is the OOB 5.5 setup). We get a 0 byte file because the js.txt file's base points to a folder that does not exist.
Is anyone else seeing the behavior? It appears that I could just rewrite the js.txt file. Are there any ramifications for doing so?
As best I can tell, that node is an empty clientlib, but it has a child node of "mbox" with the same clientlibrary category. That clientlibrary WILL produce content, and references a source folder beneath it.
http://{localhost}/libs/cq/ui/content/dumplibs.test.html?categories=testandtarget
http://{localhost}/libs/cq/ui/content/dumplibs.html?categories=testandtarget&type=JS&theme=
I am not aware of the version history, and whether it used to have valid content, or is planned to in the future.
I would be more tempted to remove or change the category than to play with the js.txt file. Editing the js.txt file will change what content goes into the clientlib. Changing/removing the category would no longer cause a call out to the zero byte file.
<cq:includeClientLib categories="testandtarget" />
=>
<script type="text/javascript" src="/etc/clientlibs/foundation/testandtarget/mbox.js">
<script type="text/javascript" src="/etc/clientlibs/foundation/testandtarget.js">

Possibility of more then one xml input to jet?

Can we give more then one xml input to jet(java emitter template)?
If we can, then please give me an example.
You can't do it directly, but there are several techniques you can use to specify multiple XML's as input.
You can name one XML file inside the other or create a third XML file that simply names the two inputs (or however many you have). Say you have an XML file named in the input XML to JET:
<inputs>
<input name="...full file name here..." />
<inputs>
You can load this file in for use in JET like this:
<c:load url="{/inputs/input/#name}" var="root"/>
The load tag reads a file (defaults to XML, but other types can be input.) and makes its contents available via the variable name you specify ("root" in this case). Normally the url attribute expects a String value that is the file name, but since we're using an attribute out of the model we use the curly brackets and xpath notation to indicate the attribute value to use as the file name.
Once you've loaded the file in you can access its contents. For example, if the root element in that XML file was and it had an attribute named company, then you attribute could access that attribute value with the c:get
<c:get select="$root/policies/#company" />
You can load as many files as you want. Just use a different variable name to refer to the root of each parsed file.
You could get a bit more complex and store your multiple files in the same directory using a naming convention. Then you could just specify the one directory path and derive the file names for all of your inputs.

Add information in zend form and file upload fail

I have 2 problems. The first problem, that I have 2 input file (Zend_Form_Element_File) and each one of the input file have to redirect the file to a different directorys. I use Zend_File_Transfer_Adapter_Http to up the files.
the files to view related with the problem is:
Controller / Form / Upload Class
http://pastebin.com/6hTADeMQ
The other problem it's that I have to show a name of file related with the record that I load in Form when I edit a record. How I can insert a div and print this information. Follow the Zend Form File: http://pastebin.com/TPAaiEPz

Unable to loacte properites file in wicket

In my wicket application i have 3-4 different packages say pack1,pack2 and so on .
In pack1 i have different html and java classes. I am validating the null check by setRequired(true) and getting the message from properties file.I am naming my properties file as Send.properties ... as i have Send.html and Send.java in pack1.In properties file i am mentioning like this
formname.field.Required=The ${label} is missing
I want to validate all the html fields which are present in different html pages of the same package (pack1)in one properties file say pack1.properties .So my question here is will one singe properties will be sufficient for one package where in all the validation will be taken care.
Yes, wicket first looks for the property in the properties file associated to the page, and then in the properties asociated to the package (and after that in parents packages...).
But, as long as I know the package properties file is called package.properties (independently of the package name).