I needed a component for specific catalog, so I've paid for it to one freelancer. As it turned out, he's not very good at his job and I was given a component that works only partly. The biggest issues are router, breadcrumbs and json array for parent categories.
1. Router
currently it shows only domain.com/menuitem/viewname?id=X. There are 4 different views that looks like are not connected at all. in db, every view has its own table as it was requested, important fields are as follows:
Main Categories (root):
id, name, alias
General Categories:
id, name, alias, root_id
General Subcategories:
id, name, alias, cat_id
Detail:
id, name, alias, subcat_id[json array]
What I would like to do is to make SEF urls to look like this: domain.com/menuitem/root_alias/category_alias/subcategory_alias/detail_alias but I was told that it can't be done this way. I checked the SEF documentation on joomla portal but I can't figure it out (if it's even possible and if not, what would be a good SEO approach).
2. Breadcrumbs
Maybe it's caused by router and separate views, but they always show Home > Menuitem, but in mainmenu it's only /alias while in breadcrumbs it's /alias/mainview. I found how to add custom breadcrumbs into pathway on joomla portal, but I can't figure out how to get parent items. If there was a solution with SQL I could use it would be enough.
3. JSON array in db
I would like to change it to integer value and add new table subcategory_detail_xref so I can find items easily. Only way I can do it now is by using regular expression in SQL which I don't think is a good idea. I've checked tutorials on joomla portal but it looks just too complicated.
Any ideas, links to examples or tutorials that can help or solutions are highly appreciated.
PS: My website is running on latest Joomla (3.5) so if there are solutions only available for 3.5+ it's fine, I don't have any plans to downgrade
For router source code, you can refer to com_content, it's similar yours, in the 3.5 version, the router has to implement an interface.
There is no detail document at Joomla Developer site, com_content is exactly what you can learn to get it.
The breadcrumb you have to develop similar of router logic
Category table should extend the JNestedTable for multiple level tree structure
Related
I have this SEO issues with Joomla, that Google Webmasters Tools catches as duplicate content, titles, description...
I have an article BABOONS with id 1, and is associated with sub-category Monkeys of parent category Animals. This parent and sub category are associated to menu items.
So, normally link to this article should be www.site.com/animals/monkeys/1-baboons
And here is the problem: If you try to access to this link trough component like this:
www.site.com/component/content/article/1-baboons
link still will be valid, and it will open this article but with no itemid associated! And, as its the same title, description, keywords and content, but different URL, google says that this is duplicate content.
I have tried many components for SEF url handling, but best case scenario was returning 404.
I have tried adding rel=canonical:
<link href="http://'.$_SERVER['SERVER_NAME'].JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid)).'" rel="canonical" />
but with no luck, because it displays current url.
My question is, if there is any redirect technique or peace of code that will redirect component/content/article/1-baboons to its parent itemid /animals/monkeys/ that actually is associated with?
Did you try using the built in redirect component? It's not the ideal solution but it will work fine if it is just one. The link that you are showing is basically the permalink, guaranteed to be unique no matter what. The question is, what is it that is leading Google's spider to that link? Usually this happens when a module or plugin is not routing a url (i.e. wrapping in JRoute()). The core ones are generally good on this (though not unknown to find a mistake) but if you have anything that is generating links that you have installed that is probably where the issue is. You can look at any of the core articles modules and see what the code should look like.
I need to make a connection between articles on different languages in Joomla, like in the menu manager. Can anybody tell me how to implement it and if it's possible without using additional plug-ins?
Update:
I already have a multilingual, but only for categories and I need configure it for articles.
There is an example below:
http://clip2net.com/s/6SElBt
Article for "Solar Energy" category and when I change the language I move to the description of this category in another language, but not in the same article.
http://clip2net.com/s/6SEkD1
How do I configure the language switching and stay on the same article?
Joomla 2.5 and later have core support for multilingual content. But there are some extra steps involved, in order to set it up properly.
There are plenty of tutorials out there: http://multilingual-joomla-demo.cloudaccess.net/multi-lingual-steps-by-steps.html
Briefly the process involves the following steps:
Enable and configure the core language plugins
Install the additional translation packs
Add the corresponding content languages
Prepare your categories structure to reflect your multilingual content. - Note that you will have a root category for all languages and then a root category for each language.
Set the main language for your homepage
Create the corresponding Menu Structure for all your languages
Start writing content for each language
Configure and Publish the Language Switcher module.
I think what you are looking for is menu items/article associations.
If the article you want to connect to another is linked to your site through a menu item, go to the menu item in question and see the association tab. There you can select what other menu item you want to connect it to.
You can also associate articles with each other by doing the same thing. Go to article manager->the article in question->association tab and choose what article you would like to link it to.
With Joomla 2.5 you can associate menu items, but not individual articles. So the best you can do is if a menu item links to a specic article, then you link the articles at the menu level.
Joomla 3 has more options, and you can indeed associate individual articles in different languages (at the article level) ... it works like a charm.
Good luck!
I've been trying to find a solution for the same issue on Joomla 2.5 but couldn't.
Today I found this link that describes how the solve the issue on Joomla 3.0:
http://www.slideshare.net/erictiggeler/creating-a-multilingual-site-in-joomla-joomla-3-beginners-guide-eric-tiggeler
I didn't try it yet but it looks like the feature is supported in Joomla 3.0.
I have created a simple basic component in joomla named, careerform so I want to know that what will be its url? Will it be :
index.php/?option=com_careerform
or in sef it will be something like:
index.php/components/careerform
or it will be like this while using .htaccess
/careerform
Is it true or what are joomla default URLs with different settings? Please tell what you know.
thanks for your time.
While what you are asking to do is possible, it would be rather complicated to rename a component. As part of the renaming you would have to update the names of dozens if not hundreds of classes throughout every file of the component. Very likely to run into some bugs because of this.
The far easier prospect is to just avoid these types of urls in your site. Joomla will only fall back to that style of url if a menu item does not exist for the view. Because of that, you can make the url into this:
http://sitename.com/any-component-alias/
To do this, go into the menu manager and create a new menu item. If you don't want this as part of the main menu, you can create a new menu. (I typically have a menu called "Hidden" for menu items that I want aliased but don't actually link to throughout the site from a menu.) When creating the menu item, make sure the type matches the component and view. The alias will then be whatever is entered in the alias box just below the title.
The one issue you may run into with this is that a component may not have a menu type for a particular view. In that case, you you would need to add the necessary metadata.xml file to the view (which again would be much easier than renaming the component!). A good tutorial for that can be found here: http://docs.joomla.org/Adding_view_layout_configuration_parameters.
yes if SEF will be enabled then index.php/component/careerform will be used.
You can create custom URLs by developing a router for your component.
There is very good documentation for it here.
I have a website which is up and running on drupal. Its product based website. I developed by creating my own tables and writing php code using php filters. I never used module concepts. Since the site is running well, so i am thinking to move to module concept. so wanted some help here, like how to do it.. i have gone through module development concepts also.
requirement.
1. Admin should be able to create new products like Mobile, Camera.
2. He should be able to define product properties and properties for which user will rate on.
3. Admin/ second admin should be able to create new sub products under products like mobile - nokia 8850 , nokia 9980 where he enters details of product properties also.
4. A listing page for all the sun products under main product. and from listing page we go to to main sub product page where user rates the product.
My confusion : should i create a new table or drupal takes care of all the requirements. and how do i start with it.
update : clear picture of requirement
ex :
1. 1st i add a product "MOBILES"
2. Then i add properties for this main product.
3. Then i start adding sub products under MOBILES i.e nokia 1100, samsumg 2200 and etc.
while adding sub products, in this page it gives me a text box for all the propeties i defined while creating the main product MOBILES . So is this possible using CCK.
You're right to consider using modules and following the "Drupal way". Use CCK + Views and Drupal will take care of the table maintenance and querying for you.
As already mentioned, you will need to get familiar with the CCK module. This module will allow you to create new "content types", which in your example would be the different product types and their attributes. Here is a good overview video on CCK. With CCK you can define new content types and Drupal will create the basic content creation forms for you and hide spare you from all the database details when you're working with it.
The Views module is essentially a query builder and will allow you to create views of your content. There are all sorts of related modules that can help you render your data as charts, grids, lists, slideshows, tables, etc.
There is a slight learning curve but once you get past it you'll be able to build new things pretty quick.
Update: Just another thought, if you are really needing to create some kind of classification system you should look at Taxonomies.
It sounds like you could do all of this with modules, without needing to do any php coding at all. Check out (if you haven't already) cck, views, and fivestar.
In response to your update, sounds like CCK and Node Hierarchy should do everything you need.
I have a series of sequentially-numbered items in several named categories, which appear as numbered lists on this page. However, the added article ID in the URL is confusing the client.
I know that Joomla now adds the article ID to URLs, and that there is no easy way of removing it. The last time I needed to alter something I hacked the relevant template, but writing URLs is more involved.
I need this:
http://vision2020.org.uk/wishlist-for-retail/131-16-local-shops.html
to become:
http://vision2020.org.uk/wishlist-for-retail/16-local-shops.html
Has anyone tackled this issue without resorting to a (possibly outdated or bloated) plug-in?
Try use a SEF component like ACEsef or sh404sef which lets you customise each url. This will be far easier than you trying to change the com_content component in order to fix your urls.