change item state from template source code

More
7 months 4 weeks ago #85073 by mcmurdok
Is it possible to change the state of an item from the category or item template source?
I use a category to show events. With extra fields I set up start and end dates.
If the event is in the past, I want the template to check this. If yes I don't want to show this event(s) anymore and for the next time the category is loading this items shouldn't be loaded because of changing its state(s).
Can anyone give an example? A example working for native Joomla doesn't consider all aspects of Flexicontent 
Code:
$article = Table::getInstance('Content', 'JTable'); $article->load($articleId);  article->state = 0; $article->store();

Regards
 

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

More
7 months 4 weeks ago #85076 by micker
hello you can do it without any code
you can use a blocker filter in your date field
read tis tutorial
www.flexicontent.org/documentation/tutor...blication-dates.html

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

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

More
7 months 4 weeks ago #85078 by mcmurdok
Thx,
can you explain how to configure a category filter for the backwards years, e.g. 2021,2022,2023 to show only items created that specific year?
Is it possible to use the "created" date instead of custom date fields?
Regards

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

More
7 months 3 weeks ago #85081 by micker
hello
you can't use created date for this but you can use coreprop field to link a custom date to created date
you can select the date mode on filter tab

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

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

More
7 months 3 weeks ago #85083 by mcmurdok
Thanks micker,
is it right, that there's no simple workflow to filter a category and its items by year based on creation date?
I mean without creating a new core prop date field and locked filters?

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

More
7 months 3 weeks ago #85086 by micker
without some work not easier
1 create a core prop and link to joomal date
2 allow filter and change display to group with year
etc ..
Maybe i can be moresimplier to use subcategory (one peer year) ?

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

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

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.405 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