Créer un champ qui pointe vers une catégorie

5 years 4 months ago #31767 by ggppdk
You can use a FLEXIcontent select / multiselect field in SQL mode.

1. Create a Select field

2. enable Use SQL Query

3. as Field elements enter:
SELECT id as value, CONCAT(REPEAT('-',level),' ',title) as text FROM `#__categories` WHERE level>0 AND extension='com_content' ORDER BY lft

4. enable Remove space

5. as Frontend Display
select "value" instead of "text"

6. as value prefix enter:
<a href="http:://mysite.com/index.php?option=com_flexicontent&view=category&id=

7. as value suffix
">Some text


-- 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 review. Thanks!

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

5 years 4 months ago #31777 by eytanpierre
Thank you for your reply ! :D

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

5 years 4 months ago #31779 by ggppdk
You are welcome, your question became an article in our FAQ ;) !!

FLEXIcontent is a free open Source project, (we will be adding donation soon), which we have spent a big amount of our time developing and supporting (bugs and common questions, and important features (of course free custom development is not possible) )

Please consider leaving a good review in JED if you have not done already

Regards


-- 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 review. Thanks!

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

5 years 4 months ago #31781 by eytanpierre
Just one more question.

How can I choose which parent categorie for the field ?
Now the parent categorie is ROOT so in the field there are all categorie of my website, and I'd like only all sub-categories of mycategorie.
I didn't test already this field with the advanced search ... but I will.

Thank you (again) for your work !

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

5 years 4 months ago #31786 by ggppdk
You can do it like this:
SELECT id as value, CONCAT(REPEAT('-',level),' ',title) as text FROM `#__categories` WHERE level>0 AND extension='com_content' AND id > (SELECT lft FROM `#__categories` WHERE id=555) AND id < (SELECT rgt FROM `#__categories` WHERE id=555) ORDER BY lft

in the above query replace 555 with the id of your top level 'mycategorie'


-- 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 review. Thanks!

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

5 years 4 months ago #31792 by eytanpierre
It's working ! Thank you very much !!! :D :D :D

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

Moderators: vistamediajoomlacornerggppdk
© 2018 Flexicontent. All Rights Reserved.