1.0.12 "Read more" is wrong

Joomla version 1.0 is end-of-life and are no longer supported. Please use Joomla 3.x instead.

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.
al0000
Joomla! Intern
Joomla! Intern
Posts: 94
Joined: Thu Feb 09, 2006 12:17 am

1.0.12 "Read more" is wrong

Post by al0000 » Fri Jan 05, 2007 1:20 am

Hello,

Ever since i upgraded to 1.0.12, the link to "Read more" on my FRONTPAGE articles, goes to:

index.php?option=com_content&task=view&id=277&Itemid=1

That isn't what it should be (all the modules that should appear only in the frontpage, now appear to the articles too)

AmyStephen
Joomla! Champion
Joomla! Champion
Posts: 7056
Joined: Wed Nov 22, 2006 3:35 pm
Location: Nebraska
Contact:

Re: 1.0.12 "Read more" is wrong

Post by AmyStephen » Fri Jan 05, 2007 2:36 am

Issue: Corrections were made to Joomla! to fix errors introduced in earlier releases relating to the ItemID. The code base related to this issue is now like it was before v 1.0.10. Before that version, we had to add IF statements in our templates if we wanted to hide the Frontpage modules when the visitor clicks the "Read more...". Some people will need to make minor template changes to the index.php file within their template. Others whose templates still have these IF statements will not notice any differences.

Resolution: Here are two code examples to help you get started. In both examples, the IF statement is designed to prevent the modules associated with the User3 location from displaying when the "Read more..." link has been clicked on the Frontpage.

#1 Example: Frontpage modules *only* appear on the Frontpage. These modules do not appear for any other menu items.  This logic only displays the modules in User3 location when the Frontpage is shown and will prevent the module from displaying when the "Read more..." is clicked.

Code: Select all

<?php if ( $option == 'com_frontpage' ) { ?>
	<?php mosLoadModules ( 'user3'); ?>
<?php } ?>
#2 Example: Modules should show on pages *other* than the Frontpage, too. This logic will display the modules in User3 location for Menu Item Pages it is supposed to display EXCEPT when the "Read more..." has been clicked.

Code: Select all

<?php if ((($Itemid == 1) && ($option == 'com_frontpage' )) || ($Itemid != 1)) { ?>
	<?php mosLoadModules ( 'user3'); ?>
<?php } ?>
#3 Example: There is already an IF statement with mosCountModules('userN'). In this case, you only need to add a check for com_frontpage to the existing IF statement. The bold red portion would be the added code.




Hope that helps. This can be complicated, so, if you have additional questions, please ask!

Amy :)

Edit - added #3 Example since many templates are like that. (Thank you, Martha!  :))
Last edited by AmyStephen on Sun Jan 07, 2007 2:13 am, edited 1 time in total.

al0000
Joomla! Intern
Joomla! Intern
Posts: 94
Joined: Thu Feb 09, 2006 12:17 am

Re: 1.0.12 "Read more" is wrong

Post by al0000 » Fri Jan 05, 2007 7:06 pm

Absolutely great!

Thanx!

mjelliott
Joomla! Intern
Joomla! Intern
Posts: 63
Joined: Thu Dec 15, 2005 1:09 pm
Location: Massachusetts, USA

Re: 1.0.12 "Read more" is wrong

Post by mjelliott » Sat Jan 06, 2007 11:21 pm

Hello,

Thanks for the solution.  Where exactly does this code go in the template index.php file?  I tried adding it to my template index file and it doesn't correct the problem.

Thanks,
Last edited by mjelliott on Sat Jan 06, 2007 11:52 pm, edited 1 time in total.
============
Dawning Point Web Sollutions - Get Ready To Succeed
http://www.dawningpointsolutions.com
============

AmyStephen
Joomla! Champion
Joomla! Champion
Posts: 7056
Joined: Wed Nov 22, 2006 3:35 pm
Location: Nebraska
Contact:

Re: 1.0.12 "Read more" is wrong

Post by AmyStephen » Sun Jan 07, 2007 1:25 am

What you need to do is identify the locations (i.e., "User1", "User9") within your template's index.php file.

If you want, you can post your index.php file as an attachment (renaming it index.txt, first), then, I'll try to take a look at it. You will need to let me know what UserN areas must be made invisible. It would help for you to also post your website address.

If you prefer to do so privately, you can email me at AmyStephen@gmail.com.

RODX
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Wed Oct 25, 2006 2:44 pm

Re: 1.0.12 "Read more" is wrong

Post by RODX » Sun Jan 07, 2007 7:55 pm

help me too ?
You do not have the required permissions to view the files attached to this post.

AmyStephen
Joomla! Champion
Joomla! Champion
Posts: 7056
Joined: Wed Nov 22, 2006 3:35 pm
Location: Nebraska
Contact:

Re: 1.0.12 "Read more" is wrong

Post by AmyStephen » Mon Jan 08, 2007 12:36 am

RODX -

It looks like your template will require the #3 Example where you must add the red code for those modules that are supposed to appear on the frontpage but not on the read more.



If you still need help - let me know which positions (i.e., 'user1', 'user2', ?) must be hidden. The way to figure that out is to look at the Module Manager page in the back end Administrator - locate the module you want hidden - and location is set for the module. Combined, the index file that you have already provided and knowing which locations you want hidden on the read more, then I can help!

I'll watch for your post!
Amy :)

RODX
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Wed Oct 25, 2006 2:44 pm

Re: 1.0.12 "Read more" is wrong

Post by RODX » Mon Jan 08, 2007 1:50 pm

Thank´s man...  the link works now.

ggouweloos
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 217
Joined: Tue Sep 06, 2005 8:13 am

Re: 1.0.12 "Read more" is wrong

Post by ggouweloos » Mon Jan 08, 2007 4:20 pm

It's great there are still possibilities there.
But...

1) How to achieve that a module is only displayed under a specific section/category?
Can this be done with a combination of the code in the examples above and the module's properties?

2) I do not want my site's admins to change PHP code. I have no problems with it myself, but the site admins know how to move and re-arrange modules.

AmyStephen
Joomla! Champion
Joomla! Champion
Posts: 7056
Joined: Wed Nov 22, 2006 3:35 pm
Location: Nebraska
Contact:

Re: 1.0.12 "Read more" is wrong

Post by AmyStephen » Mon Jan 08, 2007 4:28 pm

ggouweloos wrote: It's great there are still possibilities there.
But...

1) How to achieve that a module is only displayed under a specific section/category?
Can this be done with a combination of the code in the examples above and the module's properties?
You can define a module to appear for a certain menu by defining the "pages" property in the menu's module using the Module Manager.
ggouweloos wrote: 2) I do not want my site's admins to change PHP code. I have no problems with it myself, but the site admins know how to move and re-arrange modules.
The template index.php file is used to define the locations for modules (i.e., the User1, User2, etc. spots). If you are rearranging those locations, someone has to change the index.php. That "move and re-arrange" in a template has always been accomplished with a bit of PHP. Even the IF statements have always been there. The "php aspect" is not new.

Hope that helps! If I can review your template index.php to help you implement this change, do not hesitate to ask!
Amy :)

ggouweloos
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 217
Joined: Tue Sep 06, 2005 8:13 am

Re: 1.0.12 "Read more" is wrong

Post by ggouweloos » Mon Jan 08, 2007 6:36 pm

1) How to achieve that a module is only displayed under a specific section/category?
Can this be done with a combination of the code in the examples above and the module's properties?

You can define a module to appear for a certain menu by defining the "pages" property in the menu's module using the Module Manager.
I know, but when I publish a content item on the Frontpage it will get the ItemId=1.
The conent item can be found via the menu also Articles-News (articles = Section, News = Category)
I defined the module to show up under Articles-News via ge "pages" property.

When I click on the 'read more' link on the Frontpage I will be redirected to the item but the module will not show up, because Joomla cannot match the ItemID with the "pages" property.
The module only shows up on when someone navigates via the menu to the content item. (Which is Joomla's new way of using the ItemID since 1.0.12)

AmyStephen
Joomla! Champion
Joomla! Champion
Posts: 7056
Joined: Wed Nov 22, 2006 3:35 pm
Location: Nebraska
Contact:

Re: 1.0.12 "Read more" is wrong

Post by AmyStephen » Mon Jan 08, 2007 6:50 pm

ggouweloos wrote: When I click on the 'read more' link on the Frontpage I will be redirected to the item but the module will not show up, because Joomla cannot match the ItemID with the "pages" property.
The module only shows up on when someone navigates via the menu to the content item. (Which is Joomla's new way of using the ItemID since 1.0.12)
I understand what you are asking, now.

You are correct. When an article is defined to show up on the front page, clicking the read more gives you a different URL than clicking the "read more" for the very same article when the article appears on a Content Category Blog page. (And, therefore, the modules you want will *not* be shown.)

I believe you have three choices (or roll back v 1.0.12 to 1.0.11):

1. You can create a fake article for your front page that is only the introductory section of the real article - and insert a "fake" read more link into the introductory section with a direct URL to the "real" article page.

2. You can work with the same IF statement template logic but ONLY show the module when the ItemID is 1 and the component is NOT the frontpage (the exact opposite effect that we were talking about for others);

3. You can apply Rob's hack to return the code (in this case) to v 1.0.11 status.

Hope that helps!
Amy :)

ggouweloos
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 217
Joined: Tue Sep 06, 2005 8:13 am

Re: 1.0.12 "Read more" is wrong

Post by ggouweloos » Mon Jan 08, 2007 8:24 pm

I did hack the code earlier today, and that is working.
Also read some other topics about this issue (where I found the hack).
Too bad this will be the standard way how Joomla will work with the itemid from now on :(

All three options are workarounds, and I guess they will work fine. I will stick with patching the sourcecode till other solutions will show up. I am working with Mambo and later Joomla for over 3 years now, and I think the Menu System, Frontpage and Itemid's have been disappointing on several points. The way the devs take it with the itemID looks not very promissing to me.

AmyStephen
Joomla! Champion
Joomla! Champion
Posts: 7056
Joined: Wed Nov 22, 2006 3:35 pm
Location: Nebraska
Contact:

Re: 1.0.12 "Read more" is wrong

Post by AmyStephen » Mon Jan 08, 2007 8:42 pm

If you read the other threads, then I won't go thru the reasons why I believe these v 1.0.12 changes were critical. But, trust me, the devs aren't in love with ItemID, either! With v 2.0, the data model will change and we will be *free*! (Of course, that change will be difficult for other reasons!)

Glad you are okay. You take care...Amy :)

ggouweloos
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 217
Joined: Tue Sep 06, 2005 8:13 am

Re: 1.0.12 "Read more" is wrong

Post by ggouweloos » Tue Jan 09, 2007 6:19 am

Is there a place where I can take a look at the Datamodel and can discuss any issues I find?
Datamodeling, functional- and technical designs have been my profession for over ten years now.

Some yeras back the itemId has been introduced in Mambo mainly for the Pathway, another part that is not working like it should.
Also the itemID is used to determine what modules should display where, not working very fine either. Fronpage modules show up on 3rd Party Components and modules time after time.

AmyStephen
Joomla! Champion
Joomla! Champion
Posts: 7056
Joined: Wed Nov 22, 2006 3:35 pm
Location: Nebraska
Contact:

Re: 1.0.12 "Read more" is wrong

Post by AmyStephen » Wed Jan 10, 2007 4:25 am

ggouweloos -

Data Model for 1.0.x

Data Model for 1.5 has very, very few changes.

Good Data Model discussion on futures between Diri and mmx; this might be the thread to jump into a DB discussion, if you want. (I have no idea, really, where to suggest.)

The database will be not be changed until v 2.0; that's what makes it difficult to seriously discuss right now. But, it will be good to have another mind thinking on these things!

Good luck!
Amy :)

Edit - also, if you know of bugs, please report those   (Thanks!)
Last edited by AmyStephen on Wed Jan 10, 2007 4:28 am, edited 1 time in total.

wiggywag
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Thu May 25, 2006 10:09 am

Re: 1.0.12 "Read more" is wrong

Post by wiggywag » Thu Jan 11, 2007 8:09 pm

what about making a parameter in the content item which says something like this:

If published on frontpage let "read more" link act as menu item!

OR

Act as menu item If linked from modules (I think about modules like Latest News) or components (frontpage component)

Then give the user ability to choose between the different menu items that displays the content item!

I understand that the first time the content is added you cannot configure this feature, because you make the menu items after you added content. But to be able to do this at a point will solve the problems with modules supposed to appear together with an article!

I also understand it adds to the complexity of Joomla, but it will certaintly be a very welcome feature for many of us! Maybe it could be an extra extension to Joomla to be able to do this!

Is this possible? Or are there problems to this approach!

AmyStephen
Joomla! Champion
Joomla! Champion
Posts: 7056
Joined: Wed Nov 22, 2006 3:35 pm
Location: Nebraska
Contact:

Re: 1.0.12 "Read more" is wrong

Post by AmyStephen » Thu Jan 11, 2007 11:26 pm

IMO, we need a permanent URI for each content item (it should also be a pretty URL, rather than parameter options). Anything that links it it - be it latest news, most popular, a menu item, a category table, a read more - should use the permanent URI to display the article.

But - that type of data architecture change is not scheduled until v 2.0.

User avatar
Chipmunk
Joomla! Intern
Joomla! Intern
Posts: 57
Joined: Tue Aug 22, 2006 3:21 pm
Contact:

Re: 1.0.12 "Read more" is wrong

Post by Chipmunk » Fri Jan 12, 2007 3:41 pm

Amy-

thanks for posting this "template-hack"!  It might be not a perfect solution for everybody but it saved my day after I noticed the trouble at my site  :)
http://squirrelchess.com: A beginner's journey into the complex world of chess.

Methis
Joomla! Apprentice
Joomla! Apprentice
Posts: 32
Joined: Sun Dec 10, 2006 5:21 pm

Re: 1.0.12 "Read more" is wrong

Post by Methis » Sun Jan 14, 2007 10:50 am

Ehm...I applied Rob's hack to return the code to v 1.0.11 status and it didn't work.
Then I tried with AmyStephen's hack to index.php: for result I don't obtain module shown in an article page but I get an empty space...for example I want that right column appears only in home with some modules like recent news...with that hack in the article I don't see recent news but I still get a right coumn, that's completely empty! :(

How to solve without downgrading 1.0.11?

And, above all, how I'll manage a complex home page in future without possibility of choose easy what module and what not have to be shown in my home page and other internal pages? I'm very very afraid about this issue and the way that joomla's devs seem want to take! My home will appear like a blog in future? If so why I programmed to migrate my site from xoops to joomla and not from xoops to wordpress?
As you can read I came from xoops (and on xoops my site is currently running)...so explain me: how do devs intend to manage easy custom module on certain pages on joomla 1.5? How do they suggest to manage it on 1.0.12? I don't see any solution...or at least any solution apart to hack the code...and in my case it conitunes to be impossible! But hack the code is not a solution! A so basic feature must implemented as easy as possible by default because a joomla user can't be a programmer!
Ok...I hope I'm wrong about that....probably because I didn't understand something being new of joomla...so explain me please!

AmyStephen
Joomla! Champion
Joomla! Champion
Posts: 7056
Joined: Wed Nov 22, 2006 3:35 pm
Location: Nebraska
Contact:

Re: 1.0.12 "Read more" is wrong

Post by AmyStephen » Sun Jan 14, 2007 4:15 pm

Methis wrote: Ehm...I applied Rob's hack to return the code to v 1.0.11 status and it didn't work.
I am hearing people say this -- and it does, indeed work. I wonder if people actually understand what the hack will do? It will prevent three URLs from being created for the same content article. That is all it will do. It does not take care of the "Read more..." issue. Hope that makes more sense.
Methis wrote: Then I tried with AmyStephen's hack to index.php: for result I don't obtain module shown in an article page but I get an empty space...for example I want that right column appears only in home with some modules like recent news...with that hack in the article I don't see recent news but I still get a right coumn, that's completely empty! :(
I would say, then, that you didn't include all of the xHTML within the IF statement, properly. If there is a table or a set of DIV tags that are used to present your module, those elements must be contained within the IF statement. Otherwise, you will get the "frame" even if you don't want the module. Look at your index.php file at the location of the IF statement -- see if there is a bit more that should be included.
Methis wrote: Ok...I hope I'm wrong about that....probably because I didn't understand something being new of joomla...so explain me please!
Methis - I understand where you are coming from but I honestly believe you are overreacting. Our developers are very, very good. They have a good handle on the future. For now, at least, let's mainly get your v 1.0.12 working. I think that's enough for today!

Kind regards,
Amy :)

dpogreba
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Tue May 23, 2006 6:50 pm

Re: 1.0.12 "Read more" is wrong

Post by dpogreba » Sun Feb 04, 2007 12:48 am

I've attached my template index file here.

Thanks!
You do not have the required permissions to view the files attached to this post.

chrispapa
Joomla! Intern
Joomla! Intern
Posts: 72
Joined: Fri Feb 09, 2007 4:38 pm

Re: 1.0.12 "Read more" is wrong

Post by chrispapa » Tue Feb 13, 2007 4:48 am

Option 3 worked like a charm for me Amy!  Thanks for your interest in this problem and the thorough solution!
President/Owner of First Page Media
http://www.firstpagemedia.com | 888-732-2215

AmyStephen
Joomla! Champion
Joomla! Champion
Posts: 7056
Joined: Wed Nov 22, 2006 3:35 pm
Location: Nebraska
Contact:

Re: 1.0.12 "Read more" is wrong

Post by AmyStephen » Tue Feb 13, 2007 5:30 am

Chris - you ROCK!  8) Thanks!!!! Amy :)

hagar
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Mon Dec 18, 2006 10:24 am

Re: 1.0.12 "Read more" is wrong

Post by hagar » Tue Feb 27, 2007 9:51 am

thanks to all, sundry and especially Amy.
After searching through a multitude of articles this is exactly what I was looking for. Even a noob like myself could fix my template.

cheers

User avatar
floatingworld
Joomla! Guru
Joomla! Guru
Posts: 595
Joined: Tue Mar 07, 2006 3:42 pm
Location: Salt Spring Island, BC, Canada
Contact:

Re: 1.0.12 "Read more" is wrong

Post by floatingworld » Wed Mar 28, 2007 10:32 pm

Thanks Amy (and ohers)!

This is a nifty bit of code... Is there a list anywhere of Joomla PHP such as this?

Thanks in advance,

Aaron
http://www.mygreenhosting.com Greenhouse Gas/ Carbon Free Joomla Web Hosting!
http://www.floatingworld.ca ; - Joomla project management and support

User avatar
maxa
Joomla! Guru
Joomla! Guru
Posts: 557
Joined: Sat Aug 27, 2005 11:07 am
Location: Sweden
Contact:

Re: 1.0.12 "Read more" is wrong

Post by maxa » Tue Apr 03, 2007 6:59 am

The #1 Example would work fine for me if I could also make it happen for section blogs. I.e. I want user3 to be displayed only if com_frontpage or com_content&task=blogsection.

Is that possible?

AmyStephen
Joomla! Champion
Joomla! Champion
Posts: 7056
Joined: Wed Nov 22, 2006 3:35 pm
Location: Nebraska
Contact:

Re: 1.0.12 "Read more" is wrong

Post by AmyStephen » Tue Apr 03, 2007 2:21 pm

Maxa -

Try to use Example #2, slightly adapted.

First, find out the ItemID for the com_content&task=blogsection that you want user3 to show, then include it where I have NN.

#2 Example: Modules should show on pages *other* than the Frontpage, too. This logic will display the modules in User3 location for the FrontPage and for the menu Item NN, EXCEPT when the "Read more..." has been clicked on the Frontpage.

Code: Select all

<?php if ((($Itemid == 1) && ($option == 'com_frontpage' )) || ($Itemid == NN)) { ?>
	<?php mosLoadModules ( 'user3'); ?>
<?php } ?>
See if that works for you,
Amy :)

User avatar
maxa
Joomla! Guru
Joomla! Guru
Posts: 557
Joined: Sat Aug 27, 2005 11:07 am
Location: Sweden
Contact:

Re: 1.0.12 "Read more" is wrong

Post by maxa » Tue Apr 03, 2007 2:35 pm

Thanks Amy, but this does not sound like what I need. I have a blogsection where I want to show user3, but when readmore on that page is clicked, I want user3 to disappear... With your solution, I will still have the same itemid and user3 will show. That's why I was thrilled by the "page type rule" in Example #1.  :'(

AmyStephen
Joomla! Champion
Joomla! Champion
Posts: 7056
Joined: Wed Nov 22, 2006 3:35 pm
Location: Nebraska
Contact:

Re: 1.0.12 "Read more" is wrong

Post by AmyStephen » Tue Apr 03, 2007 3:03 pm

A blog category will provide a URL like this:

Code: Select all

index.php?option=com_content&task=blogcategory&id=59&Itemid=340
"Drilling" into an article read more will yield a URL like this:

Code: Select all

index.php?option=com_content&task=view&id=246&Itemid=340
The difference is the task value. Try using $task and see if that works (Change 340 to your Itemid, of course!).

Code: Select all

<?php if ((($Itemid == 1) && ($option == 'com_frontpage' )) || (($Itemid == 340) && ($task== 'blogcategory' )) ) { ?>
	<?php mosLoadModules ( 'left'); ?>
<?php } ?>
Try that.
Amy :)


Locked

Return to “Upgrading - 1.0.x”