Override Template/Layout of full article view

Everything to do with Joomla! 3.x templates and templating.

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.
Locked
mmair
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Sat May 02, 2009 5:06 am

Override Template/Layout of full article view

Post by mmair » Thu May 26, 2016 5:17 am

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

User avatar
JTema
Joomla! Guru
Joomla! Guru
Posts: 733
Joined: Sun Apr 13, 2008 8:10 pm

Re: Override Template/Layout of full article view

Post by JTema » Sat May 28, 2016 2:21 pm

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

mmair
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Sat May 02, 2009 5:06 am

Re: Override Template/Layout of full article view

Post by mmair » Sun May 29, 2016 6:07 pm

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!!

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 30923
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Override Template/Layout of full article view

Post by Per Yngve Berg » Sun May 29, 2016 6:56 pm

That could be done by just assigning the modules to menu items in module manager.

mmair
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Sat May 02, 2009 5:06 am

Re: Override Template/Layout of full article view

Post by mmair » Sun May 29, 2016 7:23 pm

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

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44088
Joined: Sat Apr 05, 2008 9:58 pm

Re: Override Template/Layout of full article view

Post by Webdongle » Sun May 29, 2016 7:39 pm

mmair 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. ...
Make a copy of the Template
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".

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 30923
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Override Template/Layout of full article view

Post by Per Yngve Berg » Sun May 29, 2016 7:40 pm

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.

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.

mmair
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Sat May 02, 2009 5:06 am

Re: Override Template/Layout of full article view

Post by mmair » Sun May 29, 2016 7:58 pm

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?

mmair
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Sat May 02, 2009 5:06 am

Re: Override Template/Layout of full article view

Post by mmair » Sun May 29, 2016 8:06 pm

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.

iamrobert
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 207
Joined: Sat Aug 25, 2007 8:13 am
Location: Taiwan
Contact:

Re: Override Template/Layout of full article view

Post by iamrobert » Mon May 30, 2016 3:27 am

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:

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

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 30923
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Override Template/Layout of full article view

Post by Per Yngve Berg » Mon May 30, 2016 7:56 am

If you turn off SEF, you will see the variable values on the url.

ellajames+
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Tue May 31, 2016 6:14 am

Re: Override Template/Layout of full article view

Post by ellajames+ » Tue May 31, 2016 6:22 am

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; ?>">


Locked

Return to “Templates for Joomla! 3.x”