modx is only showing html code, not the template - templates

I have installed ModX and Downloaded the "Basic" Template in the Extensionmanager! I chose the Basic Template at my first Page for the Resource! I cant find a Globalsetting to choose an Template? My problem is that if iam going to the site i only get the pure html code shown, no website! Why is this?

AFAIK there is no "Globalsetting" to choose a template. One of the nice things with MODX is that each resource can specify which template to use. So you can mix and match as required.

You could check if you have set the base href tag in head like this:
<base href="http://www.yoursite.com"/>
It will tell the site where to start looking for the other files that you have included in your markup.

Related

MkDocs - Have a file use a specific template

I’m probably not understanding something fundamental to Jinja and/or MkDocs but hopefully someone can point me in the right direction. I’m building a static website and using MkDocs. I need to have a landing page, some documentation pages and some product pages. Each of these will use different templates that extend main.html in different ways.
What I don’t understand is how to ensure that when building my pages, MkDocs knows which of my templates, say landing.html, product.html or docs.html template to use for a given markdown file, say landing.md, product1.md, product2.md, product3.md And doc1.md, doc2.md and doc3.md
The answer is to use the template key which is documented at https://www.mkdocs.org/user-guide/writing-your-docs/#meta-data

Shopify: Include a template into another template

I'm trying to customize a Shopify theme and I want to include a template into another template, but this seems to work for snippets only.
Detailed: I want to add the login / register forms into a dropdown menu in the header which appears onlick.
So I added to my theme.liquid file the following code:
{% include 'customers/login' %}
But this returns the following error:
"Liquid error: Could not find asset snippets/customers/login.liquid"
This means that include can be used only for snippets? No template can be included / called into another? Or am I missing something?
Any way around this or a direct command for templates / pages?
No Shopify template can be included / called into another template. You should rely on snippets.
Shopify {% include '' %} works only with snippets, hence why your returned error by defaults states that it looked into snippets folder and could not found what you have included as in:
"Liquid error: Could not find asset snippets/customers/login.liquid"
That pretty much says the liquid looked for the login.liquid file inside the customers folders in snippets, but could not find it!
In this case, you would want to go to templates ==> create new templates and duplicate the file you want to make changes on.

Tell TYPO3 extension to use different template using Typoscript

I'm trying to get an extension/plugin on a page to use a different template from the one its hardcoded with.
I made an html template stored in:
typo3conf/ext/myextension/pi1/new_extension_template.html
I made a typoscript template object in the root of my site (so it would definitely get picked up).
In it, I have defined the following simple Typoscript (names changed for demonstration)
plugin.tx_myextension_pi1 {
templateFile = typo3conf/ext/myextension/pi1/new_extension_template.html
}
However when I load the page containing the plugin, I get a "no typoscript template found" error on that black TYPO3 error page.
I have tried a bunch of alternative ways in case the syntax was wrong but the above worked for me when working with the tt_news plugin.
E.g I have tried these without success too:
templateFile.file = typo3conf/ext/myextension/pi1/new_extension_template.html
...
tempfile.template_file = typo3conf/ext/myextension/pi1/new_extension_template.html
Any ideas what I'm doing wrong?
Can html templates stored in typo3conf be called via typoscript stored outside the plugin?
I'm thinking perhaps html template files would have to be stored in fileadmin/plugin_templates/ for this to work.
You are mixing things: no typoscript template found means that on the page you inserted the plugin there is no TS template available.
Page with plugin isn't nested under the main page (which - as I assume - has main TS template and is displayed properly), so just drag it into the main page, or create new TS template on its level.

RenderComponentPresentation before any other markup Tridion Razor Page

I have a page template in Tridion 2011 with Razor code that prints information based on RenderComponentPresentation() as the first thing in the page. No other markup comes before it, because the component, not the page, contains the initial markup. Unless I put at least one character before the first RenderComponentPresentation in the published output, the template refuses to render any presentations.
So, for example, if this is all that is in the layout TBB this works (in my real code the tcms are real of course):
<
#RenderComponentPresentation("tcm:mytcm","tcm:myothertcm")
but this does not
#RenderComponentPresentation("tcm:mytcm","tcm:myothertcm")
The first prints the contents of the component preceded by the "<", whereas the second does nothing at all. I don't want to have ANY markup directly at the start of the page template, I want the first thing to be the component. Is it possible?
I've just done a quick test in Template Builder using the latest version of the Razor Mediator (1.2) and couldn't replicate your issue.
Maybe you could try:
<text></text>
#RenderComponentPresentation("tcm:mytcm","tcm"myothertcm")
It won't render any additional markup but may trick the mediator into doing what you want (though like I said, I can't replicate your problem so can't verify whether it does).
Normally with Razor you iterate over any and all Component Presentations on the page, and right now I'm working with
#foreach(var cp in ComponentPresentations){
#cp.RenderComponentPresentation()
}
This will render every component on the page, regardless of predefined schema's or templates. Your issue however suggest a problem elsewhere. What kind of output does your page template generate (do mind its the page template using a compound template which in turn includes the Razor TBB you describe here). Is it .aspx, HTML or other? And what is the Component templates' output? is it an HTML fragment, or anything else?
As far as you syntax goes, that should be just fine other than the template invocation:
#RenderComponentPresentation("tcm:x-xxx-xx", "tcm:xx-xxx-xx")
I have a feeling this code only works when used within HTML tags, though, but that's just a hunch.
Bit of a hack but have you tried:
<text>#RenderComponentPresentation("tcm:x-xxx-xx", "tcm:xx-xxx-xx")</text>
or
#Html.Raw(RenderComponentPresentation("tcm:x-xxx-xx", "tcm:xx-xxx-xx"))
Disclaimer: not really used Razor mediator. Just Razor.

Include templates based on current language with drupal

I'm looking for a fast way to display a particular template file based on the current language of the page.
Let's say I have two languages : english and french (english being the default)
I have various templates files, like : page.tpl.php page-node-11.tpl.php in my theme directory.
I'd like to find out a way to include these files based on the current languages; so for example if the current language is 'english', it will include 'page.tpl.php', if the current language is 'french' it will include 'fr/page.tpl.php'.
I'm sure it's pretty straight forward, but can't figure out how; in template.php ?
Thanks for any help.
Assuming you're using the Internationalization module, rather than changing the template per language, you may want to consider taking advantage of the CSS class set on the body tag. I've used that technique on sites before and it was easier than dealing with another template file. If you don't use the i18n module, you could still add the body class inside a preprocess_page function.
If a body class won't work for you, you could look at the patch from the issue above for an example of how to add the language to the variables array during preprocessing. Then see the Working with template suggestions handbook page for how to add template suggestions based on the newly added language info.