Add module position after read more in main article?

Everything to do with Joomla! 2.5 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.
Locked
baldidiot
Joomla! Intern
Joomla! Intern
Posts: 73
Joined: Sat Mar 13, 2010 1:22 pm
Location: London

Add module position after read more in main article?

Post by baldidiot » Wed Sep 16, 2015 11:48 am

Is it possible to add a new module position within directly after the read more link of an article? Ie: Between the summary and remainder of the article?

I'm comfortable editing the template if it's an easy fix, or if anyone knows of a plug in that will do this that would work too.

The site in question is: http://www.bettingsites.co/
Joomla version: 2.5.24
Template: Afterburner by Rocket Theme (http://www.rockettheme.com/joomla/templates/afterburner)

Many thanks!

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

Re: Add module position after read more in main article?

Post by Webdongle » Wed Sep 16, 2015 12:13 pm

http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"The definition of insanity is doing the same thing over and over again, but expecting different results": Albert Einstein.

baldidiot
Joomla! Intern
Joomla! Intern
Posts: 73
Joined: Sat Mar 13, 2010 1:22 pm
Location: London

Re: Add module position after read more in main article?

Post by baldidiot » Wed Sep 16, 2015 12:21 pm

Thanks - am I correct in thinking that would require editing every article though? We have over 1000 so I'm ideally looking for a way of modifying the template to be able to add the position on every page if it's possible?

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

Re: Add module position after read more in main article?

Post by Webdongle » Wed Sep 16, 2015 12:41 pm

You could try it in a Template override on the Articles default.php perhaps ?
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"The definition of insanity is doing the same thing over and over again, but expecting different results": Albert Einstein.

baldidiot
Joomla! Intern
Joomla! Intern
Posts: 73
Joined: Sat Mar 13, 2010 1:22 pm
Location: London

Re: Add module position after read more in main article?

Post by baldidiot » Wed Sep 16, 2015 2:05 pm

Ok, thanks - I'll give it a try!

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

Re: Add module position after read more in main article?

Post by Webdongle » Wed Sep 16, 2015 3:22 pm

/templates/your_template/html/com_content/article/default.php
Around line 111
change

Code: Select all

		<?php echo $this->item->text; ?>
to

Code: Select all

		<?php echo $this->item->introtext . '{loadposition Position-1}' . $this->item->fulltext; ?>
or

Code: Select all

		<?php echo $this->item->introtext . '<div class="loadpos">{loadposition Position-1}</div>' . $this->item->fulltext; ?>
Obviously Position-1 can be any position that the module is in (even a position that is not in the Template)
Now to find the code make the plugin short-code use the plugin

Addendum
Notice the dots (periods) to separate the &variables from the text( plugin short-code)

Addendum 2
Eureka !!!
Around line 111
change

Code: Select all

		<?php echo $this->item->text; ?>
to

Code: Select all

		<?php echo $this->item->introtext . JHTML::_('content.prepare', '<div class="loadpos">{loadposition Position-1}</div>') . $this->item->fulltext; ?>
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"The definition of insanity is doing the same thing over and over again, but expecting different results": Albert Einstein.

baldidiot
Joomla! Intern
Joomla! Intern
Posts: 73
Joined: Sat Mar 13, 2010 1:22 pm
Location: London

Re: Add module position after read more in main article?

Post by baldidiot » Thu Sep 17, 2015 11:20 am

Awesome, thanks for that - most appreciated!

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

Re: Add module position after read more in main article?

Post by Webdongle » Thu Sep 17, 2015 2:35 pm

baldidiot wrote:Awesome, ...
It's not difficult ... I worked it out on the fly. Just a matter of deciding what is wanted and looking for the code. Put some recognisable text in the article above and below the readmore .... put xxx in the default.php override file to locate the code that places the text. Then looked in /components/com_content/views/article/view.html.php to see how the variable $item->text is defined to display either the intro and full text or just the full text. Googled how to prepare content(custom html module has prepare content option) to use the plugin.

It's Template overrides that are 'awesome' ... so long as you understand the basics of html/css/php you don't need to be fluent in those scripts to edit the overrides.
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"The definition of insanity is doing the same thing over and over again, but expecting different results": Albert Einstein.


Locked

Return to “Templates for Joomla! 2.5”