Sign in to follow this  
Followers 0

Allow Template Logic in Pages

33 posts in this topic

Posted

I suppose we can be smart and use page templates, blocks, etc. but sometimes you just want to create a simple page and some of IPB's if statments and php tags in raw html pages is nice. Raw php pages and printing everything is just not fun.

But if it's some kind of incredibly complicated thing to do then...I suppose I can deal with it.

Aiwa and Marcher Technologies like this

Share this post


Link to post
Share on other sites

Posted

Was reading through some old support threads and found something about someone opting to just put all his code in a block and then parsing the block in the page. Yeah, that's the workaround for this it seems...so silly though. Would be better if we can just put all the nice code in the page.

Share this post


Link to post
Share on other sites

Posted

If/then logic isn't supported in IPC? really?

Share this post


Link to post
Share on other sites

Posted

[quote name='Web ◕‿◕ Developer' timestamp='1337548321' post='2269247']
If/then logic isn't supported in IPC? really?

Share this post


Link to post
Share on other sites

Posted

On a IPC page, will if/then logic work?

Conceptual example:
<if admin>
special code here
<else/>
nothing to see here people
</if>

Share this post


Link to post
Share on other sites

Posted

[quote name='Web ◕‿◕ Developer' timestamp='1337552051' post='2269256']
On a IPC page, will if/then logic work?

Conceptual example:
<if admin>
special code here
<else/>
nothing to see here people
</if>


But in an attempt to be fair to the software, you can do it if you have a PHP page and you can do it in templates and blocks.

But HTML pages themselves? No. You cannot do it.

Share this post


Link to post
Share on other sites

Posted

I'm quite sure that HTML ( and CSS ) conditionals can only be used in reference to browser versions.

<!--[if IE]>HTML code<![endif]-->

Share this post


Link to post
Share on other sites

Posted

[quote name='Sandi_' timestamp='1337567819' post='2269294']
I'm quite sure that HTML ( and CSS ) conditionals can only be used in reference to browser versions.

<!--[if IE]>HTML code<![endif]-->

Share this post


Link to post
Share on other sites

Posted

[quote name='Shigure' timestamp='1337567905' post='2269295']
Umm I'm asking for IPB template logic...


Which can be used in templates and blocks, so what else are you after?

Share this post


Link to post
Share on other sites

Posted

[quote name='Sandi_' timestamp='1337569266' post='2269299']
Which can be used in templates and blocks, so what else are you after?

Share this post


Link to post
Share on other sites

Posted

Shigure, I get what you're saying and I need this as well, either that, or the ability to set new skins per page.

Share this post


Link to post
Share on other sites

Posted

In the past Brandon said something about it being difficult on pages to deal with mixed situations of bbcode and template logic. If you need a lot of template logic, bake it into the page templates themselves or do it through blocks. As a last resort you can always make the page a PHP page.

I did this heavily on my site frontpage at http://www.gamedev.net/

Share this post


Link to post
Share on other sites

Posted

[quote name='mat206' timestamp='1339387012' post='2276347']
In the past Brandon said something about it being difficult on pages to deal with mixed situations of bbcode and template logic. If you need a lot of template logic, bake it into the page templates themselves or do it through blocks. As a last resort you can always make the page a PHP page.

I did this heavily on my site frontpage at http://www.gamedev.net/

Share this post


Link to post
Share on other sites

Posted

Apparently block is the only template plugin allowed in pages? I just tried to do parse js_module...don't see why they can't all be included. :/

Share this post


Link to post
Share on other sites

Posted

Virtually all of my IP.Content pages consist solely of a single line:

{parse=some_block_name}

and all the HTML, etc. is in the block (and the blocks it contains), primarily for the reasons in this thread. I don't think you can use things like adding to the header (for CSS, JS, etc.) in IPB-wrapped HTML pages.

It's kind of silly but it does work.

Share this post


Link to post
Share on other sites

Posted

^That... though since 2.3 I've just been including my css/js in my block templates directory... I don't have to parse it to the head :smile:
http://www.marchertech.com/blocklayout


<div class='ipsLayout ipsLayout_withright ipsLayout_hugeright'>

<div class='ipsLayout_right'>

{parse block="block_refresh"}

</div>

<div class='ipsLayout_content'>

{parse block="blocks_vertical_tabs"}

<br class='clearfix' />

{parse block="some_block"}

</div>

</div>

 :whistle:

Share this post


Link to post
Share on other sites

Posted

Smart...

Share this post


Link to post
Share on other sites

Posted

Remember what you say about opinions? Personally, my Opinion is I would rather DROP the CKE as an option in any template-able area including pages and add the processing of template logic, but that is my opinion, and would likely freak out the non-coders(I am tired of the CKE mangling my templates because joe blue cannot code and uses the cke).

Tigratrus and Michael like this

Share this post


Link to post
Share on other sites

Posted

There's a ckeditor in IP.Content? Never even noticed it...I've got that coding editor on. :P

Share this post


Link to post
Share on other sites

Posted

Is there a way to hide things on certain pages?

<if page=ccs>hide this</if>

Is an example of what I'm trying to do

Share this post


Link to post
Share on other sites

Posted

[quote name='kotaco' timestamp='1342288584' post='2286864']
Is there a way to hide things on certain pages?

<if page=ccs>hide this</if>

Is an example of what I'm trying to do


Unless you're using a page template of course.

Share this post


Link to post
Share on other sites

Posted

Hmmm, I had a method of hiding certain things on certain pages, before, but i dont know if i still have the modifications, since I didnt need it anymore.

Well if you can give me a screenshot pointing to what you want to hid or pm me your website so i can take a look via inspect element i might be able to reproduce the modification for it.

Share this post


Link to post
Share on other sites

Posted

[quote name='Christian M.' timestamp='1342326658' post='2287047']
Hmmm, I had a method of hiding certain things on certain pages, before, but i dont know if i still have the modifications, since I didnt need it anymore.

Well if you can give me a screenshot pointing to what you want to hid or pm me your website so i can take a look via inspect element i might be able to reproduce the modification for it.

it exists..... i have not released the modification(new page type) as it is rendered removed from search and quicknav as a result of being a new page type.... if that does not bother folks i can put it out there... full template logic and the native page data passed to the page(course content is not gonna be provided, you make it).

Share this post


Link to post
Share on other sites

Posted

Hmmm, is it modifiable?

Share this post


Link to post
Share on other sites

Posted

[quote name='Christian M.' timestamp='1342328691' post='2287054']
Hmmm, is it modifiable?

you are editing the template as you edit the page... so yes, i would think so, unless you mean the search, if so, only one of such a hook could fire... is messy.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Who's Browsing   0 members

    No registered users viewing this page.