http://example.com/products/2-uncategorised/
http://example.com/products/2-uncategorised/2-aaa-bb-ccccc
I have this structure, where products is a featured page with articles. What I want is just block the access to the category and related articles.
So, http://example.com/products/2-uncategorised/ or http://example.com/products/2-uncategorised/2-aaa-bb-ccccc should redirect to http://example.com/products.
The only way that i know is:
#RedirectMatch 301 ^/products/.*$ http://www.example.com/products
Note: If I change the permissions of the article, available only to Registered users then the article is removed from the featured page if the user is not registered (wrong, this page should be public).
I need to preserve all articles in featured page and block the access of the individual article and the category that it belongs.
The question: There is another way without .htaccess ?
What is the problem with having multiple paths to the same article?
Are you worried about the user experience or the effect on your SEO?
If it's the later then you have some control over this.
Using "canonical" tags, you can stipulate which is the master URL for Google et al to index.
You can also manipulate the robots setting for each category or menu item.
If it's the former, I certainly wouldn't recommend redirects in htaccess. If you absolutely must redirect, use the redirect component that comes with Joomla. Still not recommended for this.
Why don't you do away with the featured page and just use articles with their own hidden menu items. This will give a direct access, no category view. If you want to add other articles to the bottom in a blog like style, you could add articles to modules and get a similar effect?
Related
Does anyone knows an extensions that will display Joomla! articles, like a category blog layout, based on first interaction visitors choice?
I don't want to stress the visitors and to make them create a user and then select the category of interest unless it's a must do.
I want to make them choose some category of interests (News, Fashion, etc.), set a cookie with those values in their browser and then display the latest articles from those categories and remember for, let's say 30 days, the choice for further visits.
Thanks in advance!
I don't know of any extension to do this, but you could do it yourself easily enough. You could have a page to first check the cookie. If set, then you redirect to the category blog. If not, then this page has a form which collects the info and sets the cookie, and then redirects to the category blog. You could use Breezingforms for this, as it allows you to add post forms actions, so you can set your cookie.
Your category blog would have to be a custom component (I don't think you would get away with a template override of com_content here). You could copy com_content to create a new extension and then you would only need to read the cookie and adjust the categories displayed (instead of the component getting this info from the database). Everything else would be the same (if you have existing template overrides for com_content remember to copy them over).
Can anyone make me understand the difference between a featured article and a single article in joomla?
I have created two articles with same content, one as featured false and another feature true, and linked them with two menus. Both the aricles showing same. So I can't understand the difference between them. Please make me understand the difference between these two types of articles.
The Featured Articles option is useful for displaying several articles which aren't necessarily all in the same category.
A Feature Article is an option that have any article in order to mark it and display it in a link, in a menu, in a module or by default in Home page.
It is useful to display new content in Home by default or to make an article highlighted.
This is difficult to explain but I'll do my best.
I have a site with a number of articles grouped into different menus, which allows me to present relevant content to the visitor depending on what they are interested in. Each article may be in a number of menus.
I have also categorised each article based on the menu that it is most relevant to. I have done this in order to create a landing page using the category list component.
The issue I have is that the urls in the category list output do not relate to the active menu, when the article is in a number of menus. When you click on the article it takes you to the different menu. This issue is fixed if I unpublish the article from all other menus. I understand this is because Single article menu id takes precedence over category menu id's.
I need a fix that selects the active menu id rather than the default.
Any help appreciated.
Joomla cannot do what you want to do by default. In short, you have multiple URLs for each article and you want Joomla to automatically know which context that article is displayed in in order to display the right URL. Joomla can't do this.
What you need to do is that you want to override the layout module for that category and create a code that will get the right URL based on the context you are in. Not a very easy thing to do but this is how it should be done.
Note that there are some extensions, such as flexicontent, that allow articles to be listed in multiple categories, and that will handle such URLs correctly depending on the context.
I am really confused about these 2 concepts. I am basically wanting to change the appearance of the Joomla category page that lists the sub-categories in it. I dont like the default "Alternative Layout" options of Blog and List type. I want to show the sub-categories with an image + sub-category title style similar to some Portfolio layouts I've seen. So I started googling and reading a few docs on how to do this. During this time, I came across the Layout Overrides in Joomla which says that we can create alternative Joomla Layouts to display Modules, components, Category and Menu Items.
Q1) So does this mean that I can create a new layout (for portfolio category as an example) and if I place them inside "templates/myTemplate/html/com_contact/category" folder this layout option will be listed under Alternative Layout drop-down list in admin panel?
While I was reading some more, I then came across the K2 method where it says that K2 allows creating sub-templates to have different styles for each categories. I havent decided if I am going to use K2 or the core Joomla articles. But my main concern is to style some category pages differently to the default blog or list options. When I read the above article, I thought this can be done in Joomla core itself. But when I read the K2 article on Templating with K2 (and the concepts of sub-templates), it said that the core Joomla doesnt allow sub-templating and K2 can do that.
Q2) What is the difference between creating sub-templates for K2 categories and creating custom template layouts for Joomla categories?
I am totally confused here. If Joomla allows to create different layouts for categories which can then be chosen from the admin panel on what layout to use for that category, what is so special about K2's sub-templating which claims that only K2 allows the flexibility of choosing a different layout for different categories?
Can someone help me understand this please? I have been searching to understand the difference for several hours and I am still stuck on this...
I am new to Joomla and I am using the Joomla version 3.3.
There is a big difference in Joomla core Alternative-Layouts and K2's approach. Hard to explain in theory...
Joomla:
The core feature offers two choices: Either create Alt-Layouts and assign them to each Category and (each!) Article in Backend. Or with a new, alternative MenuItem. The latter is achieved through an additional XML file with same name and location. As long as you work with Categories and Listings, the result is quite similar. But it is different when it comes to the Article Fullview: You won't get an alternative layout for full view automatically! You have to assign the layout in backend or use 1 global setting from the article options. The latter will only apply to articles that have no respective Alt-MenuItem. This can result in a "chicken-egg-situation". AFAIK, frontend submission requires an alternative MenuItem for each edit-form. You can't get an alternative full-view layout when you click on a blog/list item "easily". The links from your category items still lead to the "default" without extra work. In my experience, full-view layouts are displayed in the following setups only:
Alt.MenuItem (XML) for Category and Article. A MenuItem for each article has to exist, to automatically pickup your alt.Layout.
Alt.Layout assigned to each Article. (manual work)
Alt.Layout set for Category (no XML). Only 1 global setting in Article's manager options.
K2:
The layout folder structure is simpler. All layout files live in the same folder, you just rename that container folder. e.g. products. The inner files keep their default names. This results in an easier and automated "workflow". A layout is assigned to a category and/or its sub-categories. Article full-views pick up their layout automatically, due to the file/folder structure. There is no difference between frontend/backend. No manual assignment on article edit is needed. Nor single K2 items in the menu. (not to mention, that you get extra fields per category)
Hope this helps.
I have a multi-store Magento installation for 11 different domains all selling the same product but targeting different countries, currencies and languages.
I have one CMS homepage at the moment set with content being pulled in with static blocks and a featured category. The title for all 11 websites is 'Home Page' in english.
I want to be able to change the meta title of each site, is there a way I can do this without having to create 11 separate CMS homepages in the admin and then assigning each website to it's specific CMS page? It seems overkill to have to create a separate page to change just change one line on each website.
The title, meta-keywords and meta-description are added to the page from here: Mage_Cms_Block_Page::_prepareLayout(), to be more exact, on these lines:
if ($head) {
$head->setTitle($page->getTitle());
$head->setKeywords($page->getMetaKeywords());
$head->setDescription($page->getMetaDescription());
}
I see here 2 quick options:
You override the method mentioned above and replace $head->setTitle($page->getTitle()) with $head->setTitle($this->__($page->getTitle())) and add to your translation files the translation of Home page for every language.
You override the method Mage_Cms_Model_Page::getTitle() and make it return a translated version of the title then again add Home page to your translation files.
I recommend the first option.
If you have 11 sites all selling the same item, duplicate content could very well become an issue, especially if you are dealing with hundreds+ skus. I would suggest doing the individual CMS pages like you first suggested and change more than just the META data.
Also, in System>Configuration>Design, you can change the Title Prefix and Suffix and default info per site so that may help as well.