How can I create a custom article layout?

3,165 views
Skip to first unread message

Michael

unread,
Jan 16, 2013, 4:55:52 AM1/16/13
to gantry-framework...@googlegroups.com
I've been researching how to do this but I've come to an end of what I can find out.  I'm hoping someone here can help me with this.
Currently, if "Show Navigation" is set to "Show" the navigation links appear at the bottom of the articles.  For this project I would like to copy and modify the default gantry article layout to have those navigation links at the top as well as the bottom. 
I've drilled down to /templates/gantry/html/com_content/article and found the files default.php and default_links.php which those led me to look at the base_override.php located in /templates/gantry/html but that is about as much as I can figure out.  If any of you know how I can accomplish this I would be greatly appreciative.

regards,

Michael

P.S. - for clarification purposes, I'm not asking how to do a custom template layout or a custom module layout.  I want to know how to make a custom article layout that can be chosen under "Advanced Options" for Articles under "Alternative layout"See attached picture
article layout question.png

Marian

unread,
Feb 28, 2013, 11:03:24 AM2/28/13
to gantry-framework...@googlegroups.com
I wanted to know too.

But... with gantry doesn't works.

I copied the default.php from ..\components\com_content\views\article\tmpl
(obvious with a changed name like "myarticleStyle")  without changed anything !
I assigned the newly created article override to a specific article.
As a result, on the article page it appears twice title and the content !

Someone from gantry development team can help with this issue ?

Thanks



2013/1/16 Michael <mdko...@gmail.com>

--
You received this message because you are subscribed to the Google
Groups "Gantry Framework for Joomla Users" group.
To post to this group, send email to
gantry-framework...@googlegroups.com
To unsubscribe from this group, send email to
gantry-framework-for-j...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/gantry-framework-for-joomla-users?hl=en
 
Gantry Framework Homepage: http://www.gantry-framework.org

Marcin Paczkowski

unread,
Feb 28, 2013, 1:13:13 PM2/28/13
to gantry-framework...@googlegroups.com
Hi

In Gantry is not as easy as in  other templates. As Michael noticed in html folder is base_override.php and particullar scripts for article nad blog payout just call it.

base_override.php script redirect to folder
../plugins/system/gantry/overrides/3.0/2.5/com_content/    and there are all scripts for layouts.



I do not know Gantry during actualisation change plugin but for security reason I is better to do not make changes in this folder.

I did quick test step by step:

1. Change the names of files in templates/yourtemplate/html/com_content/
article/default.php - layout of article
category/blog_item.php - layout of category view
featured/default_item.php - layout of featured articles

I just added 2 at the end eg.blog_item2.php


2. Copy the same files to the same folders from
../plugins/system/gantry/overrides/3.0/2.5/com_content/ 


3. Change the layout in those file. If you use archived articles do the same with 

archive/default_items.php


Should work


Marcin
Wiadomość napisana przez Marian <show...@gmail.com> w dniu 28 lut 2013, o godz. 17:03:

--
--
You received this message because you are subscribed to the Google
Groups "Gantry Framework for Joomla Users" group.
To post to this group, send email to
gantry-framework...@googlegroups.com
To unsubscribe from this group, send email to
gantry-framework-for-j...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/gantry-framework-for-joomla-users?hl=en
 
Gantry Framework Homepage: http://www.gantry-framework.org
 
---
You received this message because you are subscribed to the Google Groups "Gantry Framework for Joomla Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gantry-framework-for-j...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Marian

unread,
Mar 1, 2013, 3:38:35 AM3/1/13
to gantry-framework...@googlegroups.com
Thank you Marcin,
I confirm you that is working with default.php because is a normal override technique, but if I duplicate the default.php, changed the name with myarticlestyle.php and assign this alternative layout to an article, it doesn't work.
In this case the only way to work is to use the normal override.
I hope that someone from rockettheme development can explain the issue.

Cheers,
Marian


2013/2/28 Marcin Paczkowski <mpaczk...@gmail.com>

Anastasiya

unread,
Apr 5, 2013, 7:04:48 PM4/5/13
to gantry-framework...@googlegroups.com
The same problem...

Did you solve it anyway?..

четверг, 28 февраля 2013 г., 20:03:24 UTC+4 пользователь Marian . написал:
I wanted to know too.

But... with gantry doesn't works.

I copied the default.php from ..\components\com_content\views\article\tmpl
(obvious with a changed name like "myarticleStyle")  without changed anything !
I assigned the newly created article override to a specific article.
As a result, on the article page it appears twice title and the content !

Someone from gantry development team can help with this issue ?

Thanks



2013/1/16 Michael <mdko...@gmail.com>
I've been researching how to do this but I've come to an end of what I can find out.  I'm hoping someone here can help me with this.
Currently, if "Show Navigation" is set to "Show" the navigation links appear at the bottom of the articles.  For this project I would like to copy and modify the default gantry article layout to have those navigation links at the top as well as the bottom. 
I've drilled down to /templates/gantry/html/com_content/article and found the files default.php and default_links.php which those led me to look at the base_override.php located in /templates/gantry/html but that is about as much as I can figure out.  If any of you know how I can accomplish this I would be greatly appreciative.

regards,

Michael

P.S. - for clarification purposes, I'm not asking how to do a custom template layout or a custom module layout.  I want to know how to make a custom article layout that can be chosen under "Advanced Options" for Articles under "Alternative layout"See attached picture

--
You received this message because you are subscribed to the Google
Groups "Gantry Framework for Joomla Users" group.
To post to this group, send email to

To unsubscribe from this group, send email to

Marian

unread,
Apr 6, 2013, 2:10:47 PM4/6/13
to gantry-framework...@googlegroups.com
Unfortunately no!


2013/4/6 Anastasiya <anastasi...@gmail.com>
--
--
You received this message because you are subscribed to the Google
Groups "Gantry Framework for Joomla Users" group.
To post to this group, send email to

To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/group/gantry-framework-for-joomla-users?hl=en
 
Gantry Framework Homepage: http://www.gantry-framework.org
 
---
You received this message because you are subscribed to the Google Groups "Gantry Framework for Joomla Users" group.

edit

unread,
Aug 5, 2013, 6:14:37 AM8/5/13
to gantry-framework...@googlegroups.com
I need to know too. 

I think this is a basic question that Gantry Team should answer or have documented.

waiting for an answer, thanks

Alexander Rohra

unread,
Sep 15, 2013, 10:43:15 PM9/15/13
to gantry-framework...@googlegroups.com
For anyone else coming across this thread looking for an answer, have a look at the post '[SOLVED] How to implement "Alternative Layout" in Cerulean?' on RocketTheme's forum.

Alternative Layouts and Template Overrides can still be implemented following official Joomla! steps for these when a given Gantry template does not support more than one major version of Joomla! (or more precisely, more than one version of Joomla! that differ in fundamental ways to produce their output (e.g., J! 3.1 introduced tags)) in the same package. Those that do, use/already come with redirection files in the templates/gantry/html/com_content/article directory -- their filenames correspond to those that would be required to implement an Alternative Layout but their contents are identical to one another, the important bit being:

include JPATH_SITE.'/templates/'.$gantry->getCurrentTemplate().'/html/base_override.php';

The files being redirected to can be found in templates/rt_nebulae/html/joomla/<joomla version>/com_content/article (e.g., whereby <joomla version> may be "2.5") instead. These correspond in name to the redirection files but their contents are based on components/com_content/views/article/tmpl,and it is these files that you would customize, as you would if you followed the official Joomla! way of implementing "Alternative Layouts".

It appears that the XML file needed to implement an Alternative Menu Item is still only located in templates/gantry/html/com_content/article, in other words, there doesn't appear to be a way to redirect to a Joomla! version specific XML file, but I may be wrong about that.

Carter Harris

unread,
Jan 18, 2014, 1:28:22 PM1/18/14
to gantry-framework...@googlegroups.com
I'm having trouble getting the override to work. I'm using:

Joomla 3.2.1 and Gantry 4.1.20. I wanted to do exactly what a previous poster did in an earlier version: I wanted to move the print and email icons above the title. I copied the default.php file from /components/com_content/views/article/tmpl, renamed it to mydefault.php and moved it to /templates/gantry/html/joomla/3.0/com_content/article (these folders existed, I did not have to create them).

I could not find a way to indicate the file name in article options so I renamed default.php to hold_default.php and mydefault.php to default.php. 

Any suggestions would be appreciated.

Supa mic

unread,
Jan 18, 2014, 7:29:03 PM1/18/14
to gantry-framework...@googlegroups.com
I could be wrong but I'd guess you need to create a folder(s) for Joomla 3.2 as in 
/templates/gantry/html/joomla/3.2/com_content/article

because 3.0 & 3.1 & 3.2 all had major core revisions and so gantry templates still need to distinguish between them, Not until we have a stable 3.5 release will we just need 2.5 and 3.5 folders in our gantry/joomla template overrides.

charris

unread,
Jan 19, 2014, 10:04:41 AM1/19/14
to gantry-framework...@googlegroups.com
You were correct. It is now seeing the override. Thank you!

charris

unread,
Jan 26, 2014, 1:40:10 PM1/26/14
to gantry-framework...@googlegroups.com
I still have a couple of issues with this: 

1. On the page that is being overridden, the Print and Email Icons are gone and there is a cog with a dropdown but the dropdown doesn't work. I want to go back to the original icons. 

2. The article on the home page is unaffected by override. Where is the format on the home page coming from?

It's too bad the Create Overrides feature on the Templates Manager -> Template doesn't work for Gantry. 

Any insights are appreciated.

Carter
Reply all
Reply to author
Forward
0 new messages