Show article only in popup using Joomla with actual template - templates

I'm using Joomla 3.4 and want to open popup with some article only.
I have this link to load into popop: index.php?option=com_content&view=article&catid=13&Itemid=176&id=6&tmpl=component
I know that I must add tmpl=component but when I add this it load system CSS, JS and HTML layout. It doesn't load active template CSS, JS etc. Why is this happening? Without this attribute it load whole page with active template.
Thanks for advice.
Never mind! I have already done this. I just need to edit component.php file in template.

OK so I found the solution.
I just create file named 'component.php' in the template root folder and edit it as I want. I include my CSS, JS, etc to the file with my specific HTML. So if I add tmpl=component to the URL it looks for compoment.php file. That's all.

Related

Ember-cli and app structure

I am playing with ember-ci and trying to figure out where I should put the files. Most tutorials that I have found, put them in one file and it just works.
This is my application. My problem is that the templates/application.hbs doesn't render the views/index.html and the views/about/html which according to what I've read, it should render it on the outlet of the application template.
Should I put these files somewhere else?
I just went through your application. Here are a couple of mistakes I noticed.
You are putting html files in the views folder.
The template files should be put inside the templates folder with the extension hbs.
In you templates, you are specifying 'data-template-name'. But that is not necessary. Just put whatever html you want to display in that hbs file. The name of this file is the relevant part. Ember-cli uses a custom resolver. It resolves controllers, templates, view... etc based on the name of the file. You may want to go the project site to see the naming conventions. Its a bit different than the naming conventions in ember site.
Okay now here are the steps I did to get you site working.
Moved the files index.html and about.html from the views folder to the templates folder. I changed the extension of both these files to.hbs`.
Removed the script tags inside the 2 templates mentioned above.

Joomla 3 Template override a plugin

I could not find any info on overriding a Joomla plugin in my template.
Some forums claimed there was no plugin override, and the Joomla documentation (being the menacing forest that it is) either has nothing on the subject, or the page is hard to find.
So how can we override the output of a Joomla plugin in the same was we override the output of com_content or mod_contact?
I have found a way to do this:
Navigate to <joomla_homefolder>/administrator/language/<your_language>/
Search for the plugin's corresponding language file.
Copy the file name, EXCLUDING the language prefix (ie en-GB.) and the .ini suffix.
In your template create a folder named html (a common practice for template overrides).
In the html folder create a subfolder and name with the language file name as you copied it in step 3.
Navigate to the tmpl subfolder in the plugin's path: <joomla_homefolder>/plugins/<plugin_type>/<plugin_name>/tmpl
Copy the view file you wish to override into the folder you've created in step 5.
Modify the copied file to override the plugins output.
For example -
To change the page navigation buttons - modify the output of <joomla_homefolder>/plugins/content/pagenavigation:
Go into <joomla_homefolder>/administrator/language/en-GB/ and find the file named en-GB.plg_content_pagenavigation.ini.
From the filename copy only plg_content_pagenavigation.
Create a folder named html (If it does not exist already) in your theme, inside it create a subfolder and name it plg_content_pagenavigation.
Copy the view file <joomla_homefolder>/plugins/content/pagenavigation/tmpl/default.php into the plg_content_pagenavigation folder you just created.
Modify the file.
Note: I have tried it only with Joomla 3.1.
The method may not work with some plugins.
Good Luck.
In joomla 3 you can override plugins output only, that's why the origin plugin must be implemented with a tmpl.
The naming convention of the folder in you [template]/html is
plg_[type*]_[pluginElement]
Template overridden native joomla plugins is only the pagenavigation.
type* : obviously there's no sense to be other than content but if it's custom plugin no one can stop you.
On a Joomla 3.1 install, I am using the Simple Image Gallery plugin and I felt the need to override it in order to add extra functionality to each thumbnail of the gallery.
I copied all of the contents of <joomla_homefolder>/plugins/content/jw_sig/jw_sig/tmpl/ into the folder <joomla_homefolder>/templates/protostar/html/jw_sig/ and I was then able to modify both the default.php file for output modifications, and the accompanying template.css file for styling modifications. This successfully overrides the plugin's output without risking issues during future updates.
Of course, this will not work with all plugins, but it offers another alternative if you have a plugin that was nice enough to be developed with a tmpl folder.
No you can't override the same way because there is not tmpl folder because plugins really should not be rendering though of course a lot do. You probably need to clone the plugin and make a the layout your want possibly using a jlayout to make it easier to manage.
Elin's answer is not quite correct for Joomla 2.5-3.x. Some plugins do render screen output and have /tmpl folders that you may be able to override. See http://docs.joomla.org/Layout_Overrides_in_Joomla
In some cases you may need to create alternative views within the plugin /tmpl folder. For example, some of the simple, newer custom content components that use JForms let you add fields to com_content articles and select a view template for each field. Then overrides for com_content are generated dynamically to display the custom fields. Each field type can be displayed in the component area through plugins, or in a module, or within the template code, but it will use the /tmpl file you selected for the field in the CCK component. If there is a way to override the different field views from within the template folder, it must require an arcane menu structure I haven't been able to discover.

Change Joomla Template parameters

Im developing an e-commerce with Joomla 2.5 using a template which has a slideshow embedded (not a module).
I want to create an article where the client himself can easily upload images and their descriptions and urls for the slideshow.
I've managed to load a file uploader module in an article and it works. But I don't know how to change the descriptions and urls.
The descriptions and urls are template parameters and I don't know how to set them from the article.
The params.ini file in template folder is blank.. The .xml shows the 's for them but not their current value.
You are getting two functions to work, but you're missing the whole logic that links images to pages, and assigns them names, possibly manage a little security.
Why do you want to build this from scratch? You'd be so much better off with a ready-made, free, tested and supported CCK (e.g. contentbuilder, k2, sobi, zoo just to name a few).

Blogger, tumblr option for custom template

How these application allow users to upload their own templates? How is this possible?
Do they have some kind of a their own template engine or..?
Tumblr gives you two options to include your own theme:
If it is just for personal use: by changing the html of the theme. If you go to your tumblr-website and click on the customize button, you can edit the html. In the header file the content of your .css must be pasted between the <style type="text/css"> </style> tags. And you can add some javascript there. For the html I suggest to read the manual that Mirko Adari suggested: Tumblr Theme manual
If you want it to be a theme on itself: submit your theme to the Theme Garden: Tumblr Theme Garden
Blogger is a bit more rigid. Also there you can change your html file. Keep in mind that it's markup for posts is different then Tumblr. Also custom CSS files can be added (more information on that). If you are less familiar with css and html Blogger offers some buttons so that you can change the basics to your own needs. Blogger also offers a way to backup and restore your theme. A more detailed explanation can be found here. This template file must be an .xml file. More information on the markup of this xml-template can be found here.

Include a page in the template script in magnolia cms

How can I include a page from magnolia into a magnolia template script?
In the template script with I can access data from a specific page, but how can I load that page into the template?
Let's say I have 2 pages each with its own template. Page 1 contains in its tree page 2. I want to include in the template script of page 1, page 2, but doesn't work.
Thank you very much :)
UPDATED
What I actually want to do is include my header in all of my project's pages. But I don't want to put it as a paragraph, because if I ever want to change my header, I'll have to edit all the project's pages.
So what I try to do and I don't know if this is the correct approach is to create a page template for the header. This template won't include any , or css, it's just the code for the header.
The next thing I want to do is create a page in magnolia with that model to be the header.
Next I'd like to include the page I've just created in my main template model for the project, but I can't figure how to do that.
I am new to Magnolia cms and initially I tried creating my demo site using stk. The only problem was that I couldn't use jsp as a scripting language, or at least I couldn't find any solution on the internet. I don't really know freemarker, but that's not really a big problem. I'm really reluctant in using freemarker because maybe in the future in a more complex project I might need some features that freemarker doesn't support, but jsp does. I'd like to build my site using jsp if that's possible with magnolia.
I'm sorry for this long update, but if anyone has any suggestions on what a best practice could be and if I could implement what I want in jsp I would be really grateful.
Thanks again for you time :)
If you're using the STK then see this guide on content-reuse.
If not have a look at the cms tag-lib, especially the tags cms:loadPage and cms:setNode with which you can get a piece of content and set it as a JSP/JSTL variable and then render it using cms:includeTemplate.
A common scenario is to 'inherit' content from the parent page, the header is an excellent example of this. What you do is for an area you walk up the content hierarchy and render everything from the parent pages in their area with the same name. This way the header which you've only added to the top page is included in all its children.
Another option is to a have special page which simply holds things to be included in other pages. Like header, footer and banners that should go in the side pane of some pages.
Including a page within another page doesn't really work. Page 2 already has its own <html> tags, its own <script> tags, and its own CSS, so including it wholesale into another page just simply doesn't make sense.
You do, however, have a couple of options:
Use an iframe. This will allow you to include the entirety of Page 2 in a region of Page 1.
More recent versions of Magnolia will allow you to render an individual paragraph, which you could then include in another page. (For example, you can see a single paragraph from http://demopublic.magnolia-cms.com/demo-project/about/subsection-articles.html at http://demopublic.magnolia-cms.com/demo-project/about/subsection-articles/article/main/0.html.) This requires knowing a bit about the way the data is structured, but is a pretty useful way to be able to selectively extracts bits of a page.
You can use the Magnolia API in your model class to pull data from sub-pages, and then make it available to your view template. This is the approach the STK uses to build teasers that include content from the pages they reference, and is probably the most powerful and flexible approach, but it does require actually writing some Java code. (See http://documentation.magnolia-cms.com/templating/stk/templating.html and http://documentation.magnolia-cms.com/reference/templating.html for details of how to use this approach.)
(Added after question was edited) The footer functionality that's included with the STK does almost exactly this. You might be interested to take a look at that and see how it's implemented there.
Hope that helps a bit!