About 'categories' field order and customizing display output

More
8 years 4 months ago - 8 years 4 months ago #58634 by Ninjakitten
I have items with two categories each. On one set of items, the 'categories' field comes up as 'primary, secondary'; on the other set, it comes up as 'secondary, primary'. I'd prefer to be able to tell them all to be 'secondary, primary' in this case, but I'd settle for just having it be consistent. Am I doing something wrong, and is there a way to tell it in what order to report the categories? Or is there a way to get only the primary category and only the secondary category, so that I could arrange them myself?

I notice that in the Items list in the backend, one set has the white background and dotted outline around the primary category, and the other has it around the secondary category. I suspect this is related, since in both cases it's around the one that gets reported first, but I don't know quite what that CSS is supposed to mean, or how to pick which category it's on.
Last edit: 8 years 4 months ago by ggppdk.

Please Log in or Create an account to join the conversation.

More
8 years 4 months ago - 8 years 4 months ago #58644 by ggppdk
Hello

There is no difference in other difference in primary except ACL heritage

- An item is listed in all its categories.
- The primary category is different only in that the item inherits edit ACL and other ACL permissions from it


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...
Last edit: 8 years 4 months ago by ggppdk.

Please Log in or Create an account to join the conversation.

More
8 years 4 months ago - 8 years 4 months ago #58648 by Ninjakitten
Thank you, but that doesn't help with my problem. I understand what the primary (vs. secondary) category is used for, but that's not the issue.

On my site, I have things set with one set of categories (the game) as primary, and another (the character) as secondary. I want the categories field to always display as 'Character, Game', but on some items it does and on others it comes up as 'Game, Character'. I could live with the latter if it were consistent, but it isn't, and I need it to be one way or the other. It isn't putting them alphabetically, either, so that can't be the cause.

If there were a way to get the primary category and the secondary category (or categories) as separate fields, I could arrange them myself, but I don't see any way to do that.

I also would like to know what that css in the backend signifies (since it clearly isn't whether the category is primary or secondary, but does correlate to which one is displayed first in the field) and whether there's a way I can set it to be on one or the other of the categories specifically.
Last edit: 8 years 4 months ago by ggppdk.

Please Log in or Create an account to join the conversation.

More
8 years 4 months ago - 8 years 4 months ago #58654 by Ninjakitten
Since I can determine which category is which via the ids of their parent categories, I wrote a field plugin to arrange the categories in the order I want them. There really ought to be an easier way, though!
Last edit: 8 years 4 months ago by ggppdk.

Please Log in or Create an account to join the conversation.

More
8 years 4 months ago - 8 years 4 months ago #58682 by ggppdk
Hello

what you suggest makes sense and is little work:
subscribe to this issue to be notified of it being closed, add v3.0.9 milestone:
github.com/FLEXIcontent/flexicontent-cck/issues/388

Categories field, should list primary category first and add a CSS class: is_primary


Also later the categories field should get extra displays:
Code:
$field->display_nolinks $field->display_primary $field->display_secondaries


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...
Last edit: 8 years 4 months ago by ggppdk.
The following user(s) said Thank You: Ninjakitten

Please Log in or Create an account to join the conversation.

More
8 years 4 months ago - 8 years 4 months ago #58757 by ggppdk
Hello

Moved primary category to be 1st and added the CSS class

Also added viewing layout files for fields:
- categories, tags, text

Please note:
- custom layouts may need updating in future to respect new configuration and work properly
- to create new copy (same folder):

plugins/flexicontent_fields/FIELD_TYPE/tmpl/value_*.php
AS: value_mytemplate.php
OR to: /templates/SOME_NAME/html/flexicontent_fields/FIELD_TYPE/value_mytemplate.php

and then modify

You can test with GitHub version in your dev "Download Zip" and installing via Joomla installer:
github.com/FLEXIcontent/flexicontent-cck/


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...
Last edit: 8 years 4 months ago by ggppdk.

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.290 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline