Import template to Magnolia CMS - magnolia

I'm currently working with magnolia cms 5 and I know how to import xml templates. Now I need to import html5 page template, just I did not find how in documentation, and I do not belive it is impossible.

You have multiple options to achieve what you want.
If you want editors to be able to edit content of the page, you need to put html in FTL file (that you can put on class path or create on the fly in STK/Templates) and replace editable parts with markup to be filled from the user input. You would also need to create template definition, make template available to editors and create dialog. See Creating Magnolia Page Template for more details
If this html is static and not editable by users, you can still put it in FTL or you can place it in /docroot/ folder to make it available under http://your-magnolia/docroot/your-webpage.html url.
If you have magnolia module already, you can also place that html in mgnl-resources folder in your module and have it accessible via http://your-magnolia/.resources/your-webpage.html
You can also go to STK/Resources and upload your page there and have it accessible under http://your-magnolia/resources/your-webpage.html
HTH,
Jan

Related

DocFX - how to place an export to PDF button on header/footer

I'd like to place a button on the header/footer of the docfx generated site that is when clicked it downloads an already generated/saved PDF in the asset folder of the site.
Tried to scour the web for documentation on how to go about this but I don't think this is documented that well.
Any feedback will be appreciated.
To do so you should create a new template. DocFX provides a basic tutorial to do so (here).
In the new template you should copy the navbar.tmpl.partial file (resp. footer.tmpl.partial) in the _exported_templates/default/partials/ folder to modify the header (resp. footer). In these, you can add an anchor section as suggested in here.
You will have less trouble modifying the footer who is "pasted" as it is in the master layout (The navbar is populated using javascript).
Don't forget to apply the new template in your docfx.json file.

In Magnolia CMS, how can each component declare its required javascript files?

I am using Magnolia CMS 5.3.4, the STK, and freemarker (FTL) template scripts.
Some components I have defined relies on specific javascript files. Right now, what I do is that I include these javascript files in the main.ftl template script. I am looking for a way to get them included only if the specific component is present on the page.
I tried to use the jsFiles property in Template Definitions, but it seems it works only for page template definition.
The jsFiles property indeed works only for pages not for components. This is because Magnolia wants to include those files in header already, rather than loading them in middle of the body when component gets rendered.
As a general practice I would anyway recommend combining your js files into one (look at for example plugin loader in resources on how this is done) and set longer time for caching such file so that browser downloads all the script just once for the whole site rather then page by page. The bigger js file you are sending over the more overhead you are cutting off from requesting separate files and better the compression of content for transport will work.
HTH,
Jan

Drupal Style Configuration

I searched a lot on the internet to see a general answer about customizing the view of Drupal main components(if I can call them components) like Fields, Blocks, Views...
I know CSS can work and ... but I need to know if I find the html elements in which CSS files I should put the configurations.
I know it depends on theme css files. But which ones should be used for each of those components?
Thanks
Generally, the html files are in the theme folder.
If you are using Omega (for example), in the sites/all/themes/omega, you have the .tpl files, that Drupal uses to render the content.
For example, the file block.tpl.php is the file that contains the skeleton of any block in your site. Of course the content of the blocks is in the block page (not in the tpl).
The node content is in the node.tpl.php file, you may override the skeleton of any content type if you create other tpl file, for example node--article.tpl.php (for article content type).
You have html.tpl.php and page.tpl.php to customize the skeleton of your page. If you add some html in this files, this content appears in all pages.
Maybe this article helps you: https://www.drupal.org/node/171194
Regards.

publishing a tridion component presentation without a page

Can I publish component presentation without adding it to a page? The answer seems to be yes. I have a component that is not on any pages. I published just that component and the component presentation ended up at my destination, but where is the component picking up the template? Is it picking it up via the LinkedSchema tab in the template? I did link the schema used for the component to a template.
Thanks
You guessed right. A component is published as a dynamic component presentation (so without a page) if there are one or more component templates that are:
a. linked to the schema the component is based on
b. marked as 'publish as a dynamic component'
Yes, that's right. When you create a component template, you specify the linked schemas which can use this template. Publishing a component with out adding to a page is called dynamic component presentation. In component template general tab, you could specify this as "Published as dynamic component" for the field component presentations based on this template. If you have value as "Publish embedded on a page", your component presentation is static meaning you have to associate this component with page to get it published. Dynamic component presentations makes use of content broker database to query the data and to display it in website. However components embedded on a page would be static and would be served from file system (instead of database). Hope it helps!

How can I change the way my Drupal theme displays the front page

I am trying to build an website for my college's magazine. I used the "views" module to show a block of static content I created on the front page.
My question is: how can I edit the theme's css so it changes the way that block of static content is displayed?
For reference, here's the link to the site (in portuguese, and with almost zero content for now).
I can't access your site at the moment, so I'm basing this on fairly limited information. But if the home page is static content, the views module might not be appropriate. It might be better to create a page (In the menu, go to: Create content > page), make a note of the page's url, and then change the default home page to that url (Administer > Site Configuration > Site information, 'Default front page' is at the bottom). Although I might be misunderstanding what you mean by 'static content'.
But however you're creating the front page, don't edit the css in the theme - it'll get overwritten next time you upgrade. Instead you need to create a sub-theme.
As an example, if you want to subtheme Garland, in drupal 6. You first need to setup a directory for your themes. Go to sites/all/ in your drupal installation, and create a subdirectory called themes if it doesn't already exist. Go into that directory, and create a directory for your subtheme, say mytheme (i.e. sites/all/themes/mytheme/). Then use your text editor to create a file called mytheme.info in that directory, with the contents:
name = My Theme
version = 0.1
core = 6.x
base theme = garland
stylesheets[all][] = mytheme.css
And then use your text editor to create a file called mytheme.css in that directory, and put the extra CSS in there.
For more information, there's the druapl documentation on .info files and style sheets. Although, you might want to buy a book, as the online documentation isn't great.
The main css file that drives your content is the styles.css file located in your currently selected theme. In your case that means that most of your site styling is driven by this file: /aroda/roda/themes/garland/style.css with basic coloring effects handled by this file:
/aroda/roda/files/color/garland-d3985506/style.css
You're currently using Garland, the default Drupal theme included with the core download, so for best practices you shouldn't edit the included style.css file directly. Instead, you should, as Daniel James said, create a subdirectory in /sites/all called "themes".
If you're using Drupal 6, I'd follow Daniel James directions from there. If you're using Drupal 5, I'd go ahead and copy the garland directory into the themes directory and rename it for something specific to your site (aroda_v1) so you would have something like /sites/all/themes/aroda_v1 which would contain styles.css. At that point, you can edit the styles.css file directly to make any changes you see fit. Hope that helps!
It looks like most of your CSS info is in some *.css files. There is also some inline Style info on the page. Your style for the static info comes from the in-line stuff. I am not sure how Drupal generates the page but the place to start looking is for any properties for "ultima-edicao". That is what the surrounding DIV is called.

Resources