In the early days of CMSMS there was a query parameter, which if passed to any URL (served by the CMS) would skip the processing of the template and simply return the content of the main {content} tag. Is this still supported in current versions, specifically 1.12 and 2.0? And if so, can someone remind me what this parameter is?
TIA,
Sanjay
[SOLVED] Magic query parameter to skip template processing
[SOLVED] Magic query parameter to skip template processing
Last edited by spcherub on Sat Sep 12, 2015 1:09 pm, edited 1 time in total.
Re: Magic query parameter to skip template processing
For context, what I'm trying to do is implement a system where when a query parameter is passed to the page, it controls the way the template is processed. I tried something like this...
But this throws an "unclosed {else} tag" smarty error.
Any suggestions on if/how this can be achieved?
Thanks,
Sanjay
Code: Select all
{if $smarty.get.switch != 1}
<__html>
<head>...</head>
...
</__html>
{else}
Show this text
{/if}
Any suggestions on if/how this can be achieved?
Thanks,
Sanjay
Re: Magic query parameter to skip template processing
Code: Select all
?showtemplate=false
Code: Select all
{title assign='title'}
{process_pagedata}
{$articleOnly=false}
{if $smarty.post.ajaxRequest == 'true'}{$articleOnly=true}{/if}
{$htmltxt='html'}
{$headtxt='head'}
{$bodytxt='body'}
content assign='content'}
{if !$articleOnly}
<!doctype html>
<{$htmltxt}>
<{$headtxt}>
{**}
</{$headtxt}>
<!--Body-->
<{$bodytxt}>
<div id="pt-main" class="pt-perspective">
{/if}
{*start of article*}
<article>
</article>
{*End of article*}
{if !$articleOnly}
</div>
<!-- jQuery -->
<__script__ src="{root_url}/static/templates/metrika/js/jquery.js"></__script>
</{$bodytxt}>
</{$htmltxt}>
{/if}
Re: Magic query parameter to skip template processing
@veiden: thanks for the sample code. I did figure out that the head tag needed to be included indirectly. I ended up using a GCB.
Re: Magic query parameter to skip template processing
Code: Select all
?showtemplate=false
Re: Magic query parameter to skip template processing
@Jeff - thank you so much. That is exactly what I was looking for.
For my future reference, where can I find reference to this in the documentation? I looked before I asked this time, but may not have ben looking in the right places.
Thanks,
Sanjay
For my future reference, where can I find reference to this in the documentation? I looked before I asked this time, but may not have ben looking in the right places.
Thanks,
Sanjay
Re: [SOLVED] Magic query parameter to skip template processi
I don't know if it is in http://docs.cmsmadesimple.org/
But it is talked about on calguy's site http://calguy1000.com/Blogs/9/60/jquery ... -news.html
And on http://www.i-do-this.com/blog/AJAX-Form ... builder/57
But it is talked about on calguy's site http://calguy1000.com/Blogs/9/60/jquery ... -news.html
And on http://www.i-do-this.com/blog/AJAX-Form ... builder/57