Keyword

Show article title if creation date is before...

More
11 years 9 months ago - 11 years 9 months ago #107916 by ondi
I am using K2 for a football club website, and I am trying to create a fixtures/results page.

Can anyone point me in the right direction of how to make the title (which I have replaced with "Match Report") only appear when the current date becomes more than the an extra field set to date?

For example, while all fixtures will show, the "Match Report" (item title) link for a game on the 12.12.2012 will only appear after the a value set in a "Date" extra field?

You can see my table layout here: www.walthamforest-fc.co.uk/matches/new-fixtures.html

This is the code I have at the moment
<?php if ($this->item->strtotime('extrafields[20]')) > strtotime($database_date): ?>
                        <a href="<?php echo $this->item->link; ?>">
                        <?php echo "Match Report"; ?>
                </a>
                <?php else: ?>
                <?php echo $this->item->title; ?>
                <?php endif; ?>

Where extrafield 20 is the date.

Many thanks

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

More
11 years 9 months ago #107917 by william white
Replied by william white on topic Re: Show article title if creation date is before...
it should probably be strtotime($this->item->extraFields->EXTRAFIELDALIASHERE->value) with the 2.6.2 changes
see here getk2.org/blog/item/1068-k2-v262-now-available

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


Powered by Kunena Forum