Joomla! Discussion Forums



It is currently Sun Nov 08, 2009 7:29 am (All times are UTC )

 




Post new topic Reply to topic  [ 1 post ] 
Author Message
Posted: Sat Aug 05, 2006 3:07 pm 
Problem: After upgrading to version 1.0.10, clicking on a "read more" link for a content item returns the error message "you are not authorized to view this page." This can happen when a content item is only available on the frontpage or when the content item is directly linked to within the body of another content item, but is not included in any other menu item.

"Included in a menu item," means the content item belongs to is not linked via a Joomla! menu item as a linked item and its section and category have not been linked on a menu item as a blog or table. In other words, there is no menu item that has been configured to show the content item.

Background: Technically, Joomla! is designed to only show content that has been linked to a menu item. Each Menu Item is assigned a unique value for ItemID. When you click on a menu item, the URL contains an ItemID parameter with that unique value. To display properly, all content items must be associated with a menu item. The URL from the menu item can then be used as the URL for a direct link, if so desired.

Fix: The very best fix to this problem is to use Joomla! the way it was intended, designed and coded to be used. And that is to always make content items visible in the front end with a menu item. There are so many objects in Joomla! that hook into the ItemID (ex. breadcrumbs, Next and Prev, modules to be shown, templates to be used, etc., etc.). If you use Joomla! in that manner, you will save yourself MUCH trouble.

Workaround: I will characterize this remaining discussion as only a "work around." It will NOT completely resolve your problems. You will still have a "Prev and Next" issue that may bother you (unless via the Configuration you have deactivated this for the entire site - that is your only option.)

However, if you want to/need to continue directly linking to content items or only show content items on the front page and never in another location of your interface, you will need to follow these steps to PARTIALLY resolve the problem.

A. Organize your content items.

If you only have one content item that will require this treatment, then, this is not big deal. But if there are many, this problem will be easier to resolve if you place them beneath one category or at least one section with many categories. One "fake" menu item will take care of all content items in a section or category. But, if the content items in question are spread over many different sections/categories, you will have to create a separate menu item for each content item. So, consider how you want to store these items.

B. Create a "fake" menu.

1. In the back-end Administrator, select the menu item "Menu-Menu Manager."
2. Click "New."
3. Provide a value for Menu Name: "FakeMenu" and Module Title: "Fake Menu Module" and press the Save button.

C. Using the new menu, create "fake" menu item(s).

1. Select the menu option "Menu-FakeMenu."
2. Click "New."
3. There are various valid choices, depending on what you are trying to do. Write the choice down for later.
a. If there is only one content item you need to link, you can select "Link Content Item."
b. If there is an entire category of content items you need to link, you can select "Blog - Content Category" or "Table - Content Category."
c. If there is an entire section of content items you need to link, you can select "Blog - Content Section."
4. Finish defining the menu item, as you normally would, and Save.
5. Important: Note the ItemID value beneath the Itemid column for your new menu item. Write the value down for later.

D. Next, make certain your module is unpublished.

1. Select the menu option "Module-Site Modules."
2. Locate the name of your new module (i.e., "Fake Menu Module") and make certain there is a "red X" in the "Published" column. (If it has a "green check" instead, click the "green check" and it will unpublish the module.)

E. If you directly linked to content items, you need to change the URL for those links (Frontpage issues can skip this step).

NOTE: If you are only experiencing problems with content items on the front page only, skip this step and go to "Step F."

1. Now, you need to change the URL for content items you are directly linking to within other content items. That will depend on the type of menu item you created, above in "C." Here is a list of valid URL structures related to menu item type.

Note:
Change the sectionid value (XXX) to the value associated with that section.
Change the ID value (YYY) to the value associated with your content item.
Change the ItemID (ZZZ) to the value written down when you created the fake item (Step "C")

Link Content Item - index.php?option=com_content&task=view&id=YYY&Itemid=ZZZ
Blog Content Category - index.php?option=com_content&task=blogcategory&id=YYY&Itemid=ZZZ
Table Content Category - index.php?option=com_content&task=category§ionid=XXX&id=YYY&Itemid=ZZZ
Blog Content Section - index.php?option=com_content&task=blogsection&id=YYY&Itemid=ZZZ

F. Finally, your pathway (breadcrumbs) will need to be adjusted.

In your index.php file for your template, you can add a little IF statement to display "Home" and bypass the pathway for the "fake" ItemID value. (Is that what you would have wanted?) Anyway, an idea for a possible workaround.

Look for:
Code:
<div id="pathway"><?php mosPathWay(); ?></div>


Replace it with the following code BUT change the ItemID value 13 to YOUR value:
Code:
<?php if ($Itemid == 13) { ?>
   <div id="pathway">Home</div>
<?php } else { ?>
   <div id="pathway"><?php mosPathWay(); ?></div>
<?php } ?>


Last edited by AmyStephen on Mon Aug 07, 2006 9:44 pm, edited 1 time in total.

Top
   
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

Quick reply

 



Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group