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.

Marcher Technologies and Aiwa 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


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


Where did you get that from? PHP pages work just fine, but in IPB skins there is special template logic which does not work in html pages yet it works in templates.

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


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



Conceptual example:


<if admin>


special code here


<else/>


nothing to see here people


</if>


To answer your question in the simplest way possible: No.

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


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



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


Umm I'm asking for IPB template logic...

Share this post


Link to post
Share on other sites

Posted


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


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


Using it in IP.Content pages.

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


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/
I am well aware of the alternatives. But that doesn't mean I can't suggest something which would make lots of work much simpler. :)

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).

Michael and Tigratrus 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


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


No, that's what I'm asking for.

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


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


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
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.