Create another URL in Joomla 3 to same address - joomla

Is possible create a URL redirection in Joomla3 without extension/component?
For example, I have the URL:
mydomain.com/menu-alias/item
I need to make another URL to redirect to mydomain.com/menu-alias/item like:
/mydomain.com/short-url
Will I need some component/extension? or I can make it from Joomla3.

A common practice on Joomla for these types of "shortcut" URLs is to create a "Hidden" menu in the Menu Manager and simply create a menu item in that with the alias you desire.
If you decide to do this and you have multiple menu's linking to the same content I would strongly suggest that you decide which one is the canonical path and then make any other menu items of the "Menu Item Alias" type.

You can use the Redirect component.
See http://docs.joomla.org/Help33:Components_Redirect_Manager for details.

Related

Joomla 3 Overwrite/Change "Menu Manager: Edit Menu Item"

Like the topic say I want to overwrite/change the "Menu Manager: Edit Menu item" layout. To illustrate my question:
In the picture whiche is shown I want to change the labels: Layout, Option, Integration.... and add some other options to it. How can I do it? Or is this even possible?
In order to change the text, simply use language overrides, google is your friend.
In order to add functionality, let's first of all explain what we're talking about to ensure we're on the same page.
Joomla components have views which can have one or more layouts, i.e.
/components/com_content/views/category/tmpl/ contains two layouts, blog and default.
A layout can additionally contain an .xml manifest (in our case, blog.xml and default.xml) allowing us to create a menu item for the specific view/layout combination. The .xml file contains the parameters that the user will set, you can add your own as well.
When you want to change Joomla, usually there is a way to do so without touching the core, which would be pretty bad, as any Joomla! updates would break your work.
For the view layouts a special feature called template override was developed, which allows you to create an alternative to the view layout in a safe place (under your template folder, in this case your admin template), and this is the most elegant and effective way to achieve your result.
Beware though, you are just creating a layout, most likely you will want to add functionality, if it's complex you might be better off creating a dedicated component to keep the code clean. Or you can just put all the logic in your view, query the database from there. But in this latter case, get paid, and run away. Never answer the phone to the customer again.
A final alternative is to write a system plugin that will manipulate the page markup after it was generated in the event onAfterRender(). This is a simple and good approach if you only want to add a button or make minor changes, but if you do anything more than that, see the above advise about running away.

Joomla 2.5 home page aliases

I want to access my website front page via aliases: http://mysite.com/some_alias_one and http://mysite.com/some_alias_two. Later I want to take some_alias_one(as well as some_alias_two) parameter in code and proceed further actions with it. In this case I do not need any redirection. If visitor comes with alias http://mysite.com/some_alias_one, so he must stay in home page with this alias without redirection. So then in my code I will check is user using alias_one or alias_two and depending to it I will do further actions (for example show some text or modules and etc).
So any ideas?
If I am understanding you correctly, there is a somewhat simple answer. Simply make 2 menu items that point to the same thing with different aliases. Since the menu items have different aliases, they will have different item IDs and you can assign different modules to each one. You can customize each page based on the modules you add to the page.
The only issue you will have is when a use goes to http://mysite.com - you will need to create a redirect that sends the user to one of the 2 aliases you have created. Either that or one of the 2 menu items will need to be set as the default.

PyroCMS: How Do I Create a multi Segment URL ?

I want my url to be like this:
mysite.com/categories/roofing
I can achieve this by creating a new navigation group called categories and make roofing a child BUT I do not want a new Navigation group. I want to be able to call a specific function by identifying segment 1 while still having the url include segment 2.
I tried doing it in "Page Types" but it will not allow you to create a multi segment slug.
I have the stream module if that helps.
Many Thanks !!
This is actually really simple and there are a few ways to do it. The simple way would be to create a page with the slug categories (you can redirect this page using routing later if you don't want it to exist), and then create a page with the slug roofing. Finally, in the pages section of the admin, drag roofing under categories as a child.
This can also be done using routing. You would create a routes.php file with the config folder with the following:
$route['categories/(:any)'] = '$1';

How to show a module in Joomla when it's not a Menu item

I am trying to show a module, but the article I want to show the module on is not linked to a menu item. Is this possible? Seems like a module can only show when it is a menu item. But I have a ton of articles that are not menu items - so what is easiest way to show the module? Any help would be greatly appreciated.
The way to do this is as follows.
Let's suppose you have a group of articles that you wish to all display the same modules on.
Create a new category using the "category manager" option from the content menu
Ensure all the articles are published into this same category.
Create a new menu which you won't actually ever display anywhere (I like to publish the menu into a module position which is not present in the template)
Add a category blog layout option to this new menu
Now go through each of the modules that you wish to display for the group and add them to the new menu item you have created.
Hope this helps!
This will be my first answer after getting so many help through stackoverflow without being a member.
I will just add something to buzzki's answer. Because i was almost loosing my mind until i figure out how to solve.
If you used an article in a module with an extension like mod_articleasmodule; it adds the aliases of articles on URL of Read More.
Simply change the line;
$link = "index.php?option=com_content&view=article&id=".$item->id.":".$item->alias."&catid=".$item->catid.":".$item->catalias;
to
$link = "index.php?option=com_content&view=article&id=".$item->id."&catid=".$item->catid;
to get the pure URL Link and your menu assigned by MetaMod will work. Also great thanks to buzzki for help.
While the {loadposition xxx} technique is very handy, what it won't do is to put the module into any of the "standard" module positions (e.g. left, right, banner, or whatever your template has).
If you want your module in one of those positions, a great method is to use MetaMod. MetaMod is a placeholder module, that includes other modules inside of itself according to rules that you set up.
So you can set it up with a rule that says, in effect, "if we are on article A, B, C, D or E, display the module".
if ($content_genius->check("article_id = 50, 51, 52, 53, 54")) return XXX;
// replace XXX with the module id to show on those articles
Now, if the number of articles is going to change regularly, you don't want to have to edit the MetaMod to change the list of ids. So another way is to use the Meta Keywords field in the articles to determine whether the module will appear. Then all you have to do is include that keyword on any article you want the module to appear on. Let's say the keyword will be "SHOWMOD".
So in MetaMod you can simply use this:
if ($content_genius->check("article_metakeywords contains SHOWMOD")) return XXX;
// replace XXX with the module id to show on those articles
In that way, the module will appear on every article page where the article contains that meta keyword. And the module position can be any position on the page (wherever the MetaMod is assigned).
Step 1: On the front end of your website, click to the specific article that you want, highlight and copy the URL.
Step 2: Create a menu item, item type is URL and paste your article URL in there. (You can have the menu item be in an unpublished menu i think)
Step 3: Select it from the Menu Items list in the module.
You simply name your module position whatever you want, say 'monkey' where your module offers a 'select position'. You actually type it in. Then in the article you want to place it in, you add
{loadposition monkey}
to any location of your article you want the mod to work in the html editor.
Follow these steps in your joomla site Admin panel:
Go to the module manager, open the desired module and give a unique name in the position field. If you want to use it also at other common position such as left or right, then first create a copy of this module and then for the new copy, create a unique position name. Example: custom1.
Create a new article preferably uncategorized. Give it the name of your module.
In the body area of the article type {loadposition custom1} and save your article.
Create a Menu link to this article in the desired menu. You should select 'Article layout.'
Thats all, your module will now load from the menu link directly.
This has an added advantage of giving you SEO prominance based on the meta info you give for this article.

Magento - adding a new field to the product options in admin

I'd like to add a new tab to the 'catalog->manage products->product information' page in the admin. Underneath the 'images' tab, I'd like to add a new tab for video, with a simple text input for adding a video url, which I can then grab for the frontend.
Anyone any ideas where the files are that I need to edit? I've been looking for the last couple hours with no joy. I found the list of current options in Mage_Catalog_Model_Resource_Eav_Mysql4_Setup but can't figure out how to add to them...
Seems it gets some from Mage_Adminhtml_Block_Catalog_Product_Edit_Tabs. If I copy one of the tab sections here and change the title to Video, I can get it to display in the tabs on the left. But how do I then add the options for it?
What you are trying to do, from the sounds of it, is to create a custom field and add it to your catalog data. The good news is that you don't need to muck around in the PHP for that.
Head to Catalog -> Attributes -> Manage Attributes and create a new attribute for yourself called "Video URL" (or something to that effect). This will probably be a text field, and you may want to hide it from comparison on the frontend of the site (select "No" for all those boxes at the bottom of the form).
Once you've created an attribute, you will need to add it to an attribute set. If all your products are of one "type", and if you didn't create any other attribute sets, this should be only one step. Head to Catalog -> Attributes -> Manage Attribute Sets and create a "New Group" called "Video" and drag your new video url attribute into it. Save the attribute set and you should now have your new tab.
The only complication from what I read in your post could be positioning it underneath the images tab. Magento adds several tabs statically (the long way, in the PHP) and doesn't generally obey ordering of the tab groups. Consider the time tradeoff.
Hope that helps. Thanks,
Joe
Per your other comments, for the URLs a simple attribute would work but files would tend to be more difficult. To add a custom tab, as you said, you can edit (or in the case of a plugin, override) Mage_Adminhtml_Block_Catalog_Product_Edit_Tabs::_prepareLayout and add your tab. You'll need to add a block or template to display your tab contents.
After that, you'll need to store the data somewhere. Looking in Adminhtml/controllers/ProductController, you should be able to hook into the catalog_product_prepare_save event to get data from $event->getRequest() and push it onto the product or save another entity as necessary.
I'm not sure how well file saving semantics would work on a product, so you may want to do your own data storage in the extension and then provide something like a getVideoForProduct method to retrieve it.
Then the only thing left to do is modify the catalog/product/view.phtml template file to include your thumbs and create a controller in your extension to provide a modal w/ the video (or do it in JS).
I know that's a bit of a general answer, but it's the rough path you would need to take for tabs. Let me know if any specific part of that is unclear.
Thanks,
Joe

Resources