<![CDATA[ Share your MODx secrets! - My Forums]]> https://forums.modx.com/thread/?thread=1139 <![CDATA[Re: Share your MODx secrets!]]> https://forums.modx.com/thread/1139/share-your-modx-secrets?page=10#dis-post-545013 wintertribe Sep 15, 2016, 06:06 AM https://forums.modx.com/thread/1139/share-your-modx-secrets?page=10#dis-post-545013 <![CDATA[Re: Share your MODx secrets!]]> https://forums.modx.com/thread/1139/share-your-modx-secrets?page=10#dis-post-515131 Quote from: Tiger at Apr 03, 2011, 07:13 PM
Great stuff thanks!

After some more research, I've managed to put together a PHP only solution from different sources. It requires the user to enter their timezone on registration and uses that info when they log-in. I have attached a text file with a PHP example (uses a form instead of database info). I hope this will be of use to someone.

The time.txt file that Tiger was sharing now goes to a broken link page, in fact any attachment in the forums goes to a broken link page. can someone fix]]>
bigben83 Nov 18, 2014, 05:53 PM https://forums.modx.com/thread/1139/share-your-modx-secrets?page=10#dis-post-515131
<![CDATA[Re: Share your MODx secrets!]]> https://forums.modx.com/thread/1139/share-your-modx-secrets?page=10#dis-post-501658
<title>[[*UpperPageTitle]]</title>
<base href="[[++site_url]]" />
<meta name="description" content="[[*MetaDescription]]" />


...etc. Now, each page can have the meta information tweaked to the editor's heart's content.]]>
waizen Jun 27, 2014, 03:10 PM https://forums.modx.com/thread/1139/share-your-modx-secrets?page=10#dis-post-501658
<![CDATA[Re: Share your MODx secrets!]]> https://forums.modx.com/thread/1139/share-your-modx-secrets?page=10#dis-post-498813
You can define the resource field for the tplCondition and a JSON object as conditionalTpls with keys representing the condition value which determines the tpl to use.

This reduces the need to use the slow modifiers to an equivalent job and speeds up the web site. Enjoy!
]]>
apathy May 28, 2014, 09:34 AM https://forums.modx.com/thread/1139/share-your-modx-secrets?page=10#dis-post-498813
<![CDATA[Re: Share your MODx secrets!]]> https://forums.modx.com/thread/1139/share-your-modx-secrets?page=9#dis-post-473135 ballyjames21 Jul 26, 2013, 12:30 PM https://forums.modx.com/thread/1139/share-your-modx-secrets?page=9#dis-post-473135 <![CDATA[Re: Share your MODx secrets!]]> https://forums.modx.com/thread/1139/share-your-modx-secrets?page=9#dis-post-442837 After I while I discovered the "Output Modifiers" which basically does exactly the same, but without the use of an extra.

OLD:
 [[*id:is=`6`:or:is=`10`:then=`[[!ProcessSnippet]]`:else=`[[$DoThisChunk]]`]] 


but after reading this blog post by the great opengeek I realised that this formatting is better:

NEW:
 [[[[*id:is=`6`:or:is=`10`:then=`!ProcessSnippet`:else=`$DoThisChunk`]]]] 

Now the conditional is applied and for example if ID = 6 is true the result will be [[!ProcessSnippet]]... hey a snippet tag! Great, let parse that!
In the first example the ProcessSnippet & $DoThisChunk are parsed, after that the conditional is applied. So takes more time and resources...

Nowadays if I use a condtional or Output Modifier I always use this method, even if there is only one result
OLD:
 [[*id:is=`6`:then=`[[!ProcessSnippet]]`]] 


NEW:
 [[[[*id:is=`6`:then=`!ProcessSnippet`:else=`-NothingToProcess`]]]] 


So if the conditional does not apply the result will be a remark/code comment, not processed by modx: [[-NothingToProcess]]
If it does apply the result will be a snippet that gets processed.

Read Jason's blog-post if this still doesn't make sense to you....


Cheers
Michiel]]>
mintnl Nov 11, 2012, 10:50 AM https://forums.modx.com/thread/1139/share-your-modx-secrets?page=9#dis-post-442837
<![CDATA[Re: Share your MODx secrets!]]> https://forums.modx.com/thread/1139/share-your-modx-secrets?page=9#dis-post-442773
Nice sharing about Time interval..
I am not so good in Time functionality in php but you put nice quote. I just want to put code if any date match with any festival than it display the info about festival and wish all about festival..

Also it is nice when we compare the birthdate and it automatically wish user for their birthday.]]>
vinodjoshi6219 Nov 10, 2012, 12:50 AM https://forums.modx.com/thread/1139/share-your-modx-secrets?page=9#dis-post-442773
<![CDATA[Re: Share your MODx secrets!]]> https://forums.modx.com/thread/1139/share-your-modx-secrets?page=9#dis-post-431838 if ($current_time >= 12 && $current_time < 18) {$output = $greeting[1];} // Display greeting (afternoon)
I think that 8 ) is appearing as emoticon with glasses. Awesome work by the way!]]>
dinpapa Jul 31, 2012, 05:22 AM https://forums.modx.com/thread/1139/share-your-modx-secrets?page=9#dis-post-431838
<![CDATA[Re: Share your MODx secrets!]]> https://forums.modx.com/thread/1139/share-your-modx-secrets?page=9#dis-post-8651 Quote from: Tiger at Apr 05, 2011, 12:15 AM

Thanks for the compliment @BobRay. I just wanted to give something back to the community. In future, I’d like to be more detailed and helpful to newbies like myself, so that it’s just a matter of 1-2-3 or copy and paste. I’m still struggling with some of the basics myself smiley
We all were at some point (and we all still are on some issues). wink
]]>
BobRay Apr 04, 2011, 07:30 PM https://forums.modx.com/thread/1139/share-your-modx-secrets?page=9#dis-post-8651
<![CDATA[Re: Share your MODx secrets!]]> https://forums.modx.com/thread/1139/share-your-modx-secrets?page=9#dis-post-8650 ]]> Tiger Apr 04, 2011, 07:15 PM https://forums.modx.com/thread/1139/share-your-modx-secrets?page=9#dis-post-8650