Is it possible to extend Categories in ExpressionEngine 2 - expressionengine

we are currently weighing up what cms to use with Expression Engine 2 being a strong candidate.
We would like to create a bilingual site where the categories would need to be in both languages.
I see that a category has the following fields
Category Name,
Url Title,
Description,
Image url,
We would also like to add "Category Name French" and "Description French" to each category and have them editable via the control panel form.
Does any one know if this is possible?
Any pointers much appreciated

Beyond the standard ExpressionEngine Category Fields — Category Name, Category URL Title, Category Description, Category Image URL — you can add as many additional Custom Category Fields as you see necessary.
You can add/edit custom category fields in the ExpressionEngine Control Panel at:
Admin > Channel Administration > Categories > Manage Category Fields
This would allow you to add your "Category Name French" and "Description French" fields to each category and have them editable in the Control Panel.
.

I use category parents to group the individual categories, you can then easily output the required categories based on language, either via the parameter "category_group". You can then use all the default category fields and custom ones.
Basically:
English
-- category 1 (in English)
-- category 2 (in English)
-- category 3 (in English)
French
-- category 1 (in French)
-- category 2 (in French)
-- category 3 (in French)

I believe the accepted best practice for multi-lingual sites in EE2 is to use the commercial add-on Transcribe. http://eeharbor.com/transcribe

The easiest solution around bilingual categories is writing the name of the second language category in the category description input field and then use {category_description} as the name tag for that language. That is not useful if you need a description for both languages though.

this might work for you:
I haven't used EE2.0, but in EE 1.X you could create custom category fields.
Create a "{fr_category_description}" for instance
then have a read at this tutorial - http://expressionengine.com/wiki/Multi_language_site_alternative/
I implemented this on an english/welsh website and it worked very nicely
URLs look like site.com/COUNTRY_CODE/template_group/template and serve content based on this.
works by assigning a variable based on the country, then within your templates you can do:
<h1>{{country_code}_my_field}</h1>
which will translate to:
<h1>{en_my_field}</h1> for site.com/en/ or <h1>{fr_my_field}</h1> for site.com/fr
you just need to create fields with the country code as a prepended and you're good to go.
let me know if you need any clarification, can provide code from my live site.

Related

How to translate product shopping experience texts?

I have been trying to find out whether one can translate the content from Shopping experience product pages.
I have found the relevant documentation for Categories but I see no mention of the corresponding product translations.
It seems that this should be a thing that is translatable in the settings where you select the per-product configs for the blocks
I have tried the following:
Assign a layout to a product and set its value to "ENGLISH BANNER" in English
Switch to German (the "ENGLISH BANNER" is still there)
Replace it with "GERMAN BANNER".
Switch to English again and check the results.
Am I doing something wrong? Is this a bug? The Shopware version is 6.4.10. Is there a non-hacky way to translate the content from per-product for product pages in Shopping experiences?
The shop's default language is English if this is relevant.
I can reproduce this in higher Shopware versions (6.4.16.0)
The data is stored at product_translation in the slot_config field, so it looks like this should be translatable in the long run but obviously it's not yet implemented and/or a bug.
You might want to create a request at https://issues.shopware.com/
As a not-to-hacky workaround you might add your translated data to the product entity itself using a custom field. This custom field can be inserted via twig {{ customFields.my_test_field }} in the product and the translation works for such custom fields.

Show Solr Autosuggest results with types/categories

we are configuring solr for an e-commerce site which features a range of products across multiple categories and brands. In addition to that there is also a number of landing pages which can be reached through the search. So overall, we have 4 types of possible results, I'll use an electronics site as an example:
Categories (i.e. "Smartphones")
Brands (i.e. "Samsung"
Products (i.e. "Samsung Galaxy S4")
Pages (i.e. "How-To Guide to your Samsung")
What we would like solr to do is
a) show those things in autosuggest (right now it shows the first three, but doesn't show pages as they aren't part of the product catalog through which it searches)
b) show the "type" of the result in the box next to the result. To illustrate, if I would type "Sam", the autosuggest box would look something like this:
Samsung Brand
Samsung Galaxy S4 Product
Samsung Galaxy S5 Product
How-To Guide to your Samsung Page
Android Smartphones Category
Particularly the last point is really important and we couldn't find any way to do this yet. Any help would be greatly appreciated.
You can create a separate core for all the stuff you want to be able to auto complete on, where you keep both the type and the value. That way you get the flexibility of adding new auto complete features later, and you'll avoid introducing a wide set of different documents in your main core.
Another option is to add a type field to your main schema, and create documents for Page objects as well (depending on how you create the existing auto complete categories - if you have three different types of documents in the index already, it would be quick to add a new field that just contains the type of the document as well).

Need to display list of product categories

I'm exploring Nwazet.Commerce module and I've managed to replicate most of what http://nwazet.com/ does ... However I'm struggling with projection widget that displays product categorization (on nwazet.com page one to the right that has Automation, Cables & Connections, ...).
I assume these are terms for a taxonomy? How should I set projection query to get this list of terms from a single taxonomy? When I tried "Content with type CategoryTerm" it lists not just terms but also products that have them.
Thanks for any pointers.
You got it exactly right: the categories are taxonomy terms. The problem is very likely that you are displaying the terms in the projection query layout with the full detail view, where the term will display the list of items under itself. Instead, you could use a summary or a custom display type in your layout, and customize the template alternate for that display type. Alternatively, and this is how the site is set-up, you can switch to property mode for the layout and just keep it to a simple display text property with "link to the item" checked.
Some additional info: for perf, I add an eager fetch filter on Autoroute and Title part records.

Checkbox list in Orchard CMS

Is there any module in Orchard CMS that I can install to get a checkbox list? I checked in the gallery but could not find one. If there is none, is there is a workaround this?
I want to associate a product item with multiple categories (fixed set of categories).
Thanks!
EDIT :
I checked the Taxonomy module as per the suggestion. Now, I want to access the terms in the view. I have seen some posts where they can access it using
(IEnumerable<Contrib.Taxonomies.Models.TermPart>)Model.Terms
Using shape tracing, I am trying to figure out how to access the terms. My model doesn't have any terms field! I can access my custom type (Project) which has 'ProjectCategory' as Taxonomy Field. But there is no mean to view/select terms from there.
See attached screenshots.
Any idea?
I don't think there is a module specifically for checkbox lists, but it sounds like the Taxonomies module might be what you're looking for. You can add a Taxonomy field to your product content type, and define a Taxonomy for that field that contains all your categories.
Once you do that the editor page for your products will have a checkbox list (or radio select if you allow only one in the taxonomy field's settings) for the "Categories" taxonomy.
I managed to access the terms the following way :
IEnumerable<TermPart> assignedTerms = _taxonomyService.GetTermsForContentItem(contentItemId, "NameOfTaxonomy");

Create a list of pages in Orchard

Lets say for example, I have a list of products that each have it's own page... in what way can I create a single page that will list each product as it's contents as a list (with hyperlinks)? Not really sure how to do this directly in Orchard - or will I need to create a custom page / widget? Thanks for any help... new to Orchard and not sure how to tackle this.
You have a couple options. I believe the Orchard gallery at orchardproject.net has a module called Simple Commerce that may solve your problem. (it's simple so it might not)
(In the following section, I've tried to boldface the terminology words that are 1) are crucial to understanding how to use Orchard and 2) helpful in finding your way around the dashboard)
Another option may be first creating a Content Type--probably one named Product with some Fields describing an individual product. Price, SKU and description come to mind, but you'll be better able to describe your own products. Each Content Type in Orchard can be associated with any combination of Parts. You may have to research which ones you actually want for an individual product, but I'd recommend:
Body (this could replace the Description I suggested above) You could include any amount of HTML/script in this section to make your individual product pages look fancy!
Common (this has to be added when Containable is used)
Containable (this will allow the items to be listed)
Route (so you can link to a specific product)
This gives each product its own slug (URL)
Tags (to allow products to be categorized)
Now, you need to create a new List from the dashboard so you can display the products together (and inherit other features like pagination, etc). Be sure to select the Product Content Type in the Contains drop down list.
Then, you can start creating your Content (your Products) one by one. In the dashboard, click the new Product item and describe each new piece of Content.
Finally, you can link directly to this new List using the Products List's *slug*. You could (and might want to) add the Products List to your main navigation menu. Clicking the Products List and checking the "Show on main menu" box will automagically add a navigation button directly to this page. You could, of course, link to this List from anywhere using the slug (also found on the list's edit page)
This page, from the Orchard documentation pages describes more things you can do with a list of content like modifying the layout of the list, placing content fields in different places and even converting your products to widgets which you could use to display some promotional product offering in a special spot on your site.
I highly recommend reading through at least the documentation provided on the Orchard site to get a good grasp of what this CMS can do out of the box and what you would need to write custom code to accomplish (which you could do in this case, but Orchard can handle it out of the box)
Hope this helps!
Two ways to do this:
http://orchardproject.net/docs/Creating-lists.ashx and http://orchardproject.net/gallery/List/Modules/Orchard.Module.Contrib.Taxonomies

Resources