Joomla Ghost URL - php

I have an issue where a component link is passed correctly in the fact that the correct page is returned. But the "Option" part of the URL is shown incorrectly.
index.php/component/projxproject/projectform
is what should be passed, but
index.php/dashboard/projectform
is what is passed.
I have a component com_proxproject, whithin it, is a various set of views, project form, project, project list ect, and a view called dashboard, which is a roll-up of other info.
I created a Menu / Dashboard icon set with links to the various pages, but the paths are changed form what should be. example:
href="<?php echo 'index.php?option=com_projxproject&view=projectform&id=. 0', false, 0; ?>"
to the other one with dashboard in it. Its still goes to the page but I'm currently trying to filter Menus and Menu Items based on the "option" variable of the URL and the "/Dashboard/" is messing it up.
Any help would be great.
EDIT!!!!
I have solved 2 of 3 issues. This is due to Joomla's routing trough the menu links, the solution to the one above is:
href="<?php echo ('index.php?&Itemid='. 357); ?>"
Still working on one with no menu link. The links for articles ...in my case reports...are created individually as in, connecting to a particular article/report, I don't want to and cant create links to every item, so I need to pass a link with the item->id not just the menu ItemID...

Related

Where to find a list of pages automatically renderable in Drupal and how it works?

In the pages .tpl.php of my theme i can find several lines like
render($action_links)
displaying whole pages with a single command. Sometime i saw that the render argument is a block from my theme .info, but other times i see arguments i cannot identify that render default pages or elements of drupal.
How it works? And where i can find a list of default displayable pages?
In particular, i needed to display the content of the default drupal page "add content" in one of my pages, and i'm pretty sure i can do it using this render method, but i cannot find the correct argument.
EDIT: I found something like
drupal_render(node_add('NODE_TYPE'));
that seems to allow the display of a node add form, but what i need is the main add content page, containing the list of all the type of nodes that a user can add.
Are you new to Drupal? When I read your post, I'm almost sure that you have missed something with the Drupal's working. The variables you found in render() functions are "calculated" somewhere else in the code (in the modules part for the most).
You cannot find a list of constant variables to display them just like this.
I found this article about these mysterious variables that are rendered and I hope it will help: http://newsignature.com/articles/the-magic-behind-drupals-render-elements
If you just want to display the "add content" form somewhere on your site, just call its path (node/add).
EDIT AFTER CLARIFICATIONS:
First of all, you can set on which page you want the user lands after login. (I don't know why you're still talking about user profile template. Maybe I missed something again.)
But if I did understand what you're trying to achieve, I'll do that:
Create a menu (or simply use the "Navigation" menu that seems to be exactly what you need) with all the actions users can do. And I'll place this menu in the main content region. Do create a menu, go to Administration>Structure>Menus>Add menu. And add links like "node/add/article" or "node/add/news" or "node/add/page" or whatever your content-types are.
Place this menu in the region you want. If you want it to be like the main content of the page, place it in the main container. To do so, go to Administration>Structure>Blocks> Drag and drop your menu in the right region and Save.
Configure this block to appear only on the front page (the first page on user arrives after logged in) if you want so. To do so, in the Blocks administration page, click on "Configure" next to your block and check "show block on specific pages: Only the listed pages" and write down <front>
Create roles and permissions for your different sorts of users. That will automatically show them the links they are allowed to see. To set permissions, go to Administration>People>Permissions and check in the "Node" section which content-type each role can create.
I hope I didn't forget anything. Please tell me if it is clear enough.

How to keep track of related table id in other controller?

I'm building a module in Prestashop that requires multiple Controllers.
I decided to add them in the Tab, with one visible (the front one), and the others that are related to the first one, in hidden.
When I go to that main admin controller via the menu, it works fine, listing the various elements (renderList) and adding/updating/deleting them also.
Now, when I click on a the view icon, I go to my other admin controller that manage that specific entry (sub list, with it's own form, but related to the parent id).
The problem now, is that I redirect by keeping the correct url, but then, on my sub page, if I click on create for example, I lost the parent_id. And after that, I can't create an entry because it's missing it's parent id.
How can I do to say to this sub controller to keep the id I gave it ?
So far, the only solution I come from is to do like this :
In my sub controller, I should always have id_other_model in the url, so I added this method :
public function initProcess() {
parent::initProcess();
self::$currentIndex .= '&id_other_model='.(int)Tools::getValue('id_other_model');
}
And so far it works well.
If there is a better alternative, I'd appreciate to know it :)

Joomla article pretty url that's not tied to a menu

I am working in Joomla 1.5 and have an article that I don't want listed in any of my menus. It is a special promotional page that exclusive people will be given the link to. Is there a way to give the article a pretty URL?
Currently the URL that works is /index.php?option=com_content&view=article&id=35. I would like that to be /15k.
Anyone help me?
I have seen this question, but the URL isn't quite what I'm looking for.
To get that URL you will need Joomla!'s SEF/SEO settings turned on (I'm assuming you've already got that setup).
In Joomla you have to create a new menu, call it something like "Utility Menu" but don't give it a "Module Title" - you don't want to display this menu so you don't need the module.
Then create a "Single Article" menu item with the alias 15k as a menu item within the "Utility Menu". You should now be able to access the article at the http://www.yoursite.com/15k
If you want to link to this from another menu create a menu item alias and point it at the 15k menu item. If you want to link from within an article simply point the link to the 15k menu item.
[Edit]
Routing in Joomla! first looks through the user defined paths (i.e. menu's and their menu items) then if it can't find a match for the requested resource that way it asks the particular component to build the route and if the components router is basic (i.e. nearly every single one in Joomla! 1.5) then you get the ?option=com_somecomponent&id=X style result. In 2.5 this is much improved but still uses the same routing mechanism.

Using ExpressionEngine's {category_name} on a permalink page?

I need help with a simple issue I'm having on a site built with ExpressionEngine 2.
I have a category which links to a "view" page using {title_permalink='product/view'}. On this page, I want to create a link to take the users "back" to the category (e.g. Back to Toys). How do I create this link?
For example, I would've thought this code would work:
{exp:channel:category_heading channel="project"}
<p class="pfloatRight"> Back to {category_name}</p>
{/exp:channel:category_heading}
But it doesn't as ExpressionEngine doesn't know which category the entry is in. I tried enabling related_categories_mode but it didn't help.
Any ideas? I know this is a simple fix, I'm just not used to working with categories.
If you don't mind outputting all the categories an entry is assigned to, you can offer a link "back to a category" from your product view permalink page.
Put the following code within your exp:channel:entries tag loop:
<p class="pfloatRight">
Back to
{categories backspace="2"}
{category_name},
{/categories}
</p>
Which would output something like:
<p class="pfloatRight">
Back to Category Name, Category Name
</p>
You'll notice I placed the "Back to" text outside the {categories} variable pair so it doesn't get repeated and used the backspace parameter to remove the comma from the last category.
The apparent downside is that if there's more than one category assigned to an entry, it may be confusing for the user to remember which category they navigated from.
I'd argue that most people are accustomed to using their browser's Back button rather than any on-page links, so trying to determine the actual category they came from may provide little return on investment.
However, even if these "Back to Category" links aren't necessarily useful to users, they do provide SEO benefits for people who may land on a product page from a search result and want to see more items in the same category.
If you only have one category assigned to the product, you can do this within your channel:entries loop:
{categories limit="1"}
<p class="pfloatRight">Back to {category_name}</p>
{/categories}
If you're using multiple categories per-product, then you'd have to use an add-on (or custom code) that stores the URL history for you (like this one) and retrieve the last-visited page that way.
Your code looks like it should work. What's the URL you're trying to execute this code from?

Customizing joomla search result page layout

The joomla search results appear on the home page. I want it to show up on a new page. According to some online posts I had to modify the mod_search.php to set the item id to a non existing item so i set it to 0, but the problem is that the changes are not being reflected in my search module at all. I also tried putting a hidden field called itemid in the modules/mod_search/tmpl/default/default.php form but even that is not picked, I set the form target equal to _blank and tried to change the action page of the form to say index.php?Itemid=0 instead of index.php but all of this does not seem to reflect on the search module. When i manually change the itemid in the browser location box to 0, the results show up on a different page (thats what i want).
Please suggest what should I do?
Try to change request method of search form:
<form ... method="get">
<input type="hidden" name="itemId" value="0" />
or like this
<form action="...?itemId=0" method="post">
In Joomla 2.5 there is "itemId" field in mod_search properties, if set it to some non existent item than it clean ups search results page from modules which binding to some exact menu items(pages) and left only modules which are binding to "All" pages.
I know this is an older post, but I have found an easy solution for this for use with Joomla 1.6 and wanted to share it. It is a core hack, which isn't optimal because it will go away during upgrades, but it is easy to do.
What folks (like me) have been searching for is to allow a user to enter text in the search box on a page and have the results display in a blank page within the template, rather than have the results display within the same page along with other content, or be forced to use a menu item to send users to a separate search page.
When using a Search box within the Joomla! page to initiate a search, it is the 'component' portion -- not the 'module' -- of Search that is being used. There is a section in the Search Component Controller that either sets an ID for use with a menu, or automatically sets the result to come from and display in the requesting page. We just need to turn that off to send the search results to a blank page.
So, in /components/com_search/controller.php -- comment out the following code:
/* // set Itemid id for links from menu
$app = JFactory::getApplication();
$menu = $app->getMenu();
$items = $menu->getItems('link', 'index.php?option=com_search&view=search');
if(isset($items[0])) {
$post['Itemid'] = $items[0]->id;
} else if (JRequest::getInt('Itemid') > 0) { //use Itemid from requesting page only if there is no existing menu
$post['Itemid'] = JRequest::getInt('Itemid');
}
*/
This will display the search results within the content portion of a blank page of your template. At least it did for me.

Categories