Override Template/Layout of full article view
Moderator: General Support Moderators
Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
-
- Joomla! Apprentice
- Posts: 6
- Joined: Sat May 02, 2009 5:06 am
Override Template/Layout of full article view
Hello friends
Is it possible to override the layout of the full article view? i need something like this:
http://www.inet.edu.ar/index.php/seguim ... ra-federa/
To put the image of the article in full view at the top, full width, fixed height, and over that image, logo to the link and menu to the right, and the title of the article, center bottom over the image (this layout will be different of the main template)
Is something like that possible?
Thanks in advance!
Nikita
Is it possible to override the layout of the full article view? i need something like this:
http://www.inet.edu.ar/index.php/seguim ... ra-federa/
To put the image of the article in full view at the top, full width, fixed height, and over that image, logo to the link and menu to the right, and the title of the article, center bottom over the image (this layout will be different of the main template)
Is something like that possible?
Thanks in advance!
Nikita
- JTema
- Joomla! Guru
- Posts: 733
- Joined: Sun Apr 13, 2008 8:10 pm
Re: Override Template/Layout of full article view
I think you do not need to override full article layout for slide and menu over it . You need to override top slider module position and place the menu over it. Then you can make an override for full article view. the last thing you can do other things with joomla's own settings. (eg. Publish right side module on the page you desired)
http://www.joomlatema.net - Joomla Extensions and Templates
https://asgardia.joomlatema.net - Asgardia Joomla Gardening Template
https://asgardia.joomlatema.net - Asgardia Joomla Gardening Template
-
- Joomla! Apprentice
- Posts: 6
- Joined: Sat May 02, 2009 5:06 am
Re: Override Template/Layout of full article view
thanks for your advice muratyil.
I solved it like this. In index.php i used this
$app = JFactory::getApplication();
$menu = $app->getMenu();
if ($menu->getActive() == $menu->getDefault())
to know if i am in frontpage
and in 'else' option i define a new distribution of modules for the template.
then i override the default.php of article view, using img full text to put it under the menu and logo.
It is working.
Thanks!!
I solved it like this. In index.php i used this
$app = JFactory::getApplication();
$menu = $app->getMenu();
if ($menu->getActive() == $menu->getDefault())
to know if i am in frontpage
and in 'else' option i define a new distribution of modules for the template.
then i override the default.php of article view, using img full text to put it under the menu and logo.
It is working.
Thanks!!
- Per Yngve Berg
- Joomla! Master
- Posts: 30923
- Joined: Mon Oct 27, 2008 9:27 pm
- Location: Romerike, Norway
Re: Override Template/Layout of full article view
That could be done by just assigning the modules to menu items in module manager.
-
- Joomla! Apprentice
- Posts: 6
- Joined: Sat May 02, 2009 5:06 am
Re: Override Template/Layout of full article view
hmm i dont think so, because i need the frontpage template for another views, for example category views as blog. Articles per se are not asigned to menu items... just the category of the article, and then i show them in category blog view.
I have to determine how to know if i am in the category view in my index.php
I have to determine how to know if i am in the category view in my index.php
- Webdongle
- Joomla! Master
- Posts: 44088
- Joined: Sat Apr 05, 2008 9:58 pm
Re: Override Template/Layout of full article view
Make a copy of the Templatemmair wrote:hmm i dont think so, because i need the frontpage template for another views, for example category views as blog. Articles per se are not asigned to menu items... just the category of the article, and then i show them in category blog view. ...
Edit the copy to remove unwanted module positions and create a module position for your image slider
Set the copy as default Template
Assign the original Template to the default menu item
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".
- Per Yngve Berg
- Joomla! Master
- Posts: 30923
- Joined: Mon Oct 27, 2008 9:27 pm
- Location: Romerike, Norway
Re: Override Template/Layout of full article view
Your code does not check what View, only that you are on the Default Menu item.
Here is some more code that can be useful.
Advanced Module Manager is also an Extension that can assign modules to views.
Here is some more code that can be useful.
Code: Select all
$app = JFactory::getApplication();
$doc = JFactory::getDocument();
// Detecting Active Variables
$option = $app->input->getCmd('option', '');
$view = $app->input->getCmd('view', '');
$layout = $app->input->getCmd('layout', '');
$task = $app->input->getCmd('task', '');
$itemid = $app->input->getCmd('Itemid', '');
Advanced Module Manager is also an Extension that can assign modules to views.
-
- Joomla! Apprentice
- Posts: 6
- Joined: Sat May 02, 2009 5:06 am
Re: Override Template/Layout of full article view
Per Yngve Berg, thanks for the reply! yes, i knew that.. i was researching how to check in what view i was and i didnt understand much how joomla manage those variables.
In the active variables that u have sent me, which one is for the category view?
In the active variables that u have sent me, which one is for the category view?
-
- Joomla! Apprentice
- Posts: 6
- Joined: Sat May 02, 2009 5:06 am
Re: Override Template/Layout of full article view
or how to detect if i am in article full view, that would be better. The article is not assigned to a menu item but to a category that is assigned to a menu item. Just the article full view needs a different layout in whole site.
-
- Joomla! Enthusiast
- Posts: 207
- Joined: Sat Aug 25, 2007 8:13 am
- Location: Taiwan
- Contact:
Re: Override Template/Layout of full article view
Could the construct framework help?
https://github.com/construct-framework/ ... /logic.php
You could assign by itemid - alternatively you can set the class of page
There are also by categories:
https://github.com/construct-framework/ ... /logic.php
You could assign by itemid - alternatively you can set the class of page
There are also by categories:
Code: Select all
#-------------------------------- Item ID ---------------------------------#
$itemId = $jinput->get('Itemid');
#------------------------------- Article ID -------------------------------#
if ($view == 'article') {
$articleId = $jinput->get('id', '', 'INT');
} else {
($articleId = NULL);
}
#--------------------------------- Alias ----------------------------------#
if ($itemId) {
$currentAlias = $app->getMenu()->getActive()->alias;
}
iamrobert Design | Taiwan
https://www.iamrobert.com
https://www.iamrobert.com
- Per Yngve Berg
- Joomla! Master
- Posts: 30923
- Joined: Mon Oct 27, 2008 9:27 pm
- Location: Romerike, Norway
Re: Override Template/Layout of full article view
If you turn off SEF, you will see the variable values on the url.
-
- Joomla! Fledgling
- Posts: 1
- Joined: Tue May 31, 2016 6:14 am
Re: Override Template/Layout of full article view
Copy the tags.php file from: /layouts/joomla/content/
Paste the tags.php file into: /templates/protostar/html/layouts/joomla/content/
In line 22 of tags.php, add theses classes to the <a> tag: btn btn-primary (leave an empty space after that). The full line of code will look like this:
<a href="<?php echo JRoute::_(TagsHelperRoute::getTagRoute($tag->tag_id . '-' . $tag->alias)) ?>" class="btn btn-primary <?php echo $link_class; ?>">
Paste the tags.php file into: /templates/protostar/html/layouts/joomla/content/
In line 22 of tags.php, add theses classes to the <a> tag: btn btn-primary (leave an empty space after that). The full line of code will look like this:
<a href="<?php echo JRoute::_(TagsHelperRoute::getTagRoute($tag->tag_id . '-' . $tag->alias)) ?>" class="btn btn-primary <?php echo $link_class; ?>">