I am developing a Joomla website based on K2 with a multilingual front end editing possibility. This all works nicely, except for one thing: previewing K2 items in another language than you are using to edit them.
For example:
When Joomla is set to Dutch, I can edit the English item without a problem. However, I cannot view this item directly without first selecting 'English' as language for the site, otherwise the direct link to the item doesn't work.
I managed to work around this by modifying the getData() function in the K2ModelItem, so that the language is not checked there anymore. However, Joomla is still set to Dutch, it is not a 'real' preview of what the item would look like.
Therefore, I am looking for a solution to temporarily switch the language of Joomla to the language of the item (English in this example) AND switch it back directly, to be able to continue editing in Dutch after viewing the preview. Do you think this is possible? What code would I need to implement this automatic switching?
Let me know if I need to provide more information. Maybe someone has an inventive solution, thanks.
[edit]
It seems that forcing the $lang parameter in the item URL does a good job, together with the modification in K2ModelItem I described. But this only works with SEF disabled. I'd like to hear if there are other suggestions.
Related
I am using a Drupal 6.32 + Ubercart 6.x-2.13 installation with all of the latest updates in terms of internationalization.
I am having a problem with the Language Switcher.
The Language Switcher is only working 66% of the time
The website in question is www.holistichorsecare.com and it works most of the time.
Main Catalog Page -> OK
If you go to Catalog:
www.holistichorsecare.com/catalog
(switch)
www.holistichorsecare.com/zh/catalog
The Language Switcher works just fine.
Product Page -> OK
If you choose any given product
www.holistichorsecare.com/products/aromadog-arf-ritis-pain-relief-1oz
(switch)
www.holistichorsecare.com/zh/products/aromadog-arf-ritis-pain-relief-1oz
The Language Switcher works just fine.
Categories View Page -> NOT OK
But if you are in the category browse of the website for a particular type, (say Dogs), the Language Switcher does not work the way I want it to. The translation is not working 100% correctly - or I have set up translation incorrectly.
www.holistichorsecare.com/products/catalog/dogs
(switch)
www.holistichorsecare.com/zh/products/catalog/dogs
>>THIS IS NOT WHAT I AM EXPECTING BECAUSE I HAVE A TRANSLATED TAXONOMY<<
What I am expecting to see is this:
www.holistichorsecare.com/zh/products/catalog/護犬系列
My Translated (Ubercart) Taxonomy
In the catalog taxonomy, I have:
1) Set Dogs to English
2) Set 護犬系列 to Traditional Chinese
3) Set the translation for 護犬系列 to Dogs
So what I want to happen when I use the Language Switcher is to see the "護犬系列" catalog in the (zh) context, not the "dogs" catalog in the (zh) context.
Confused & Frustrated
I've been working on this for several days now, without any luck at all, so I'm reaching out to the Drupal/Ubercart community for advice.
Does anyone have any for me? I think this might be a (catalog) taxonomy translation problem, but toying with the taxonomy in a million different ways has not proved fruitful and now I'm totally confused and frustrated.
Edit
I am now convinced that this is actually a locale.module / Language Switcher problem and that's where I think the energy needs to be directed. I realize that the Language Switcher project may have had little to do with the Ubercart project, which may have resulted in the emergence of this situation - which is probably fairly limited to multilingual Ubercart installations.
I have reached out to some prominent people in the locale.module world and I hope they can see clear to helping here, or at least assisting in the creation of a uc_language_switcher module (or even block code) that is Ubercart specific.
Still, any help or suggestions gratefully accepted.
g.
I have experienced this as well, and it's a tricky one to solve. If you're using the basic taxonomy pages and have a simple term structure, you may find some luck by implementing hook_alter_translation_link() in a custom module to modify the URL provided to the language siwtcher. See i18n_alter_translation_link() for an example on doing so.
In this hook, you'll have to parse the URL to load the term and then find its translation so that you can return the modified link. What makes this potentially problematic is that parsing the URL means if you use Views with term name translation, you'll need to parse the name to get the term ID yourself.
On the site I was working on, I had a taxonomy with parent/child terms and was using a View with a taxonomy term argument to construct the catalog. The View term argument was configured to use term name translation and replace spaces with dashes, so parsing the URL ended up being difficult.
I am to develop a Joomla 3.1 Template. The template should consist of a static header and footer, as well as multiple pages, all of which need their own styling. Further, the client would like to be able to add 'events' to a specific listings page. Customers should be able to book said events via a simple form.
Thanks to some really basic guides, I have the header and footer down, as well as some simple template options. However, I am now running into some problems;
How would I approach the content section? Ideally, a page would consist of multiple, editable sections. The client would be able to edit said sections in the backend without having to deal with or accidentally changing the layout or styling of the page itself. Since there are multiple pages, I obviously need different views/containers for each of them. Is this possible and if so, how?
Another problem is the documentation, which I found to be very lacking. Even google only got me so far (basic structure, index.php, templateDetails.xml and so forth). Are there any other resources I may have missed or do I really need to refer to other templates (most of which, obviously, aren't free) and use var_dump all the time?
Writing this, I just realized that I could theoretically build a template for every single page but ... that surely can't be right, right?
If someone could provide a basic outline or at least tell me how you personally would tackle a project like this, it'd be very much appreciated.
All the best
Edit;
I just found some video tutorials but since my bandwidth is limited, I cannot watch them. Please take this into account when writing an answer. Thanks.
I have only one word for you :
GANTRY :D
gantry-framework.org
Joomla revolves around menu items that point to components. For each menu item, you can assign modules to different positions within the template to create a unique page. You only need one template if you really understand how Joomla templating works.
Joomla has very good documentation here - http://docs.joomla.org/
Few things to remember -
Component - this is a type of content or app of sorts. A component will define what content is and how it is displayed. This can be anything from blog articles and categories to an event registration system to a message board or social network. Menu items generally will point to a view in a component.
Modules - these are used to display additional content around the component output. This can be a menu, or a login box, or a weather widget or anything else you can come up with. Modules can be assigned to or excluded from the various menu items on your site.
Plugin - plugins are used to change the final output on a site. They can be used to insert Youtube videos, or forms within content, or even to alter the meta tags on a page.
Understanding how extensions work is an important first step. Once you get how those work, learning how templates and template overrides work will give you most of what you need to know to build a basic Joomla site.
I just recently started working with a Magento site, and so far I'm really not liking it. I need to remove a couple links from the main navigation, but I can't seem to find the option for it. I've googled it numerous times, and all I see are examples for coding the navigation. My question is, can you edit the site navigation like you can with say wordpress? Seeing how it's a cms I'd imagine the user should be able to make changes to the navigation using some type of interface, and without having to pull the files from the server and edit them.
Also just out of curiosity, for anyone experienced with Magento would you say it's a good choice for a cms? I've heard of it before, but haven't seen many sites that use it.
No!, so you have three options here.
Learn how to extend the navigation with the 100's of tutorials out there, it is really not that hard, assuming you have a theme you just have to edit app/design/frontend/[theme]/default/template/page/html/topmenu.phtml
Get an extension to do it for you.
Hire a developer to do it for you, we create a static block with installer for the html which make it slightly more user friendly to update in the future.
Stackoverflow is a bad place to ask questions like this, it is aimed at programmers and doing such a procedure is rudimentary stuff, I really hope you are a client trying to be cheap rather than someone who claims they can run this site.
Edit: The cms features are ok but you need to be able to code to set them all up so the end user can make the changes with WYSIWYG.
If you don't want to code for navigation then you can do below things
1) Create category and then Display Settings=>Display Mode=>static block only and Display Settings=>CMS Block=>static block name. In static block u can include in page url or custom page
2)You need to hire developer
If you're using Magento and have an integrated WordPress blog, it's possible to design a completely custom menu in the WordPress Admin using the menu builder. You have complete control over what menu items you want and the hierarchy of each item.
To get this to work, you need to integrate your WordPress blog using WordPress Integration in full integration mode. Your Magento template also has to be using the default Topmenu block.
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 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.