سؤال

Since I switched to SEF URL I don't have any more access to the ID + itemid number (previously showed in the URL).

I'm looking for a way to get these info from the front-end.

Joomla 2.5 has no real front-end settings.

A basic module that would retrieve these info's (for registered user) would be super. I did try to find an extension that would display these crucial infos about the page but without success.

any ideas?

هل كانت مفيدة؟

المحلول

There's a few ways to go this information:

1) You can use some simple code to get it, you can put this practically anywhere from a template to a custom module (Not custom_html, but a module you build from scratch):

$input = JFactory::getApplication()->input;
$itemid = $input->getInt('Itemid');

$articleid = $input->getInt('id'); // this might also be 'cid'

2) In the menu manager when you are creating a link to a page you can get the non-sef link. Just go to the menu item of the page on the backend and you'll find the the non-sef link is there: index.php?option=com_content&id=5&catid=4 The only thing that isn't in that string is the Itemid, you'll have to append it yourself by just typing in: &Itemid=xy at the end of wherever you're using it.

3) If you use an extension like JCE to edit your content for wherever you're building links this will automatically look up the proper item ID for the article you're linking too.

4) If you're using a SEF tool like shs404sef you can look at all your SEF URLs and locate the non-sef one related to it.

نصائح أخرى

I did insert this code in a module like jumi (set the access to registered only)

<?php 
$input = JFactory::getApplication()->input;
$itemid = $input->getInt('Itemid');
echo "Itemid =".$itemid; 
?>
<br />
<?php
$articleid = $input->getInt('id'); // this might also be 'cid'
echo "Article ID =".$articleid; 
?>
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top