Jump to content


Photo

Allow Template Logic in Pages


  • Please log in to reply
32 replies to this topic

#1 Rimi

Rimi

    Strip Me

  • +Clients
  • 6,121 posts

Posted 29 March 2012 - 03:21 PM

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

#2 Rimi

Rimi

    Strip Me

  • +Clients
  • 6,121 posts

Posted 07 April 2012 - 01:12 PM

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.

#3 ᴡᴅツ

ᴡᴅツ

    ⊙﹏⊙

  • +Clients
  • 1,677 posts

Posted 20 May 2012 - 04:12 PM

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

Feature consistency across IP.Downloads and IP.Board for IP.Content

 

 

IPS, please look at the topics I've created regarding feature suggestions. There still are issues that haven't been addressed, as noted above, and the following, as well as this.


#4 Rimi

Rimi

    Strip Me

  • +Clients
  • 6,121 posts

Posted 20 May 2012 - 04:38 PM

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.

#5 ᴡᴅツ

ᴡᴅツ

    ⊙﹏⊙

  • +Clients
  • 1,677 posts

Posted 20 May 2012 - 05:14 PM

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

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

Feature consistency across IP.Downloads and IP.Board for IP.Content

 

 

IPS, please look at the topics I've created regarding feature suggestions. There still are issues that haven't been addressed, as noted above, and the following, as well as this.


#6 Rimi

Rimi

    Strip Me

  • +Clients
  • 6,121 posts

Posted 20 May 2012 - 08:08 PM

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.

#7 Sandi_

Sandi_

    Code Addict

  • +Clients
  • 1,099 posts

Posted 20 May 2012 - 09:36 PM

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

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

Twenty years ago we had Johnny Cash, Bob Hope and Steve Jobs.

 

Now we have no Cash, no Hope and no Jobs. PLEASE! Don't let Kevin Bacon die.


#8 Rimi

Rimi

    Strip Me

  • +Clients
  • 6,121 posts

Posted 20 May 2012 - 09:38 PM

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

#9 Sandi_

Sandi_

    Code Addict

  • +Clients
  • 1,099 posts

Posted 20 May 2012 - 10:01 PM

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


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

Twenty years ago we had Johnny Cash, Bob Hope and Steve Jobs.

 

Now we have no Cash, no Hope and no Jobs. PLEASE! Don't let Kevin Bacon die.


#10 Rimi

Rimi

    Strip Me

  • +Clients
  • 6,121 posts

Posted 20 May 2012 - 10:46 PM

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

Using it in IP.Content pages.

#11 Atti

Atti

    IPB Full Member

  • Members
  • PipPipPip
  • 102 posts

Posted 23 May 2012 - 10:12 AM

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

#12 mat206

mat206

    Advanced Member

  • +Clients
  • 439 posts

Posted 10 June 2012 - 10:56 PM

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/

#13 Rimi

Rimi

    Strip Me

  • +Clients
  • 6,121 posts

Posted 10 June 2012 - 11:20 PM

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

#14 Rimi

Rimi

    Strip Me

  • +Clients
  • 6,121 posts

Posted 10 June 2012 - 11:29 PM

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. :/

#15 raindog308

raindog308

    Advanced Member

  • +Clients
  • 294 posts

Posted 10 June 2012 - 11:49 PM

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.
BlackBeltDL.com: Martial arts home study program reviews and discussion forum

#16 Marcher Technologies

Marcher Technologies

    $life=FALSE;$code=TRUE;$time--;

  • +Clients
  • 11,747 posts

Posted 11 June 2012 - 12:14 AM

^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:

#17 Rimi

Rimi

    Strip Me

  • +Clients
  • 6,121 posts

Posted 11 June 2012 - 12:17 AM

Smart...

#18 Marcher Technologies

Marcher Technologies

    $life=FALSE;$code=TRUE;$time--;

  • +Clients
  • 11,747 posts

Posted 11 June 2012 - 12:22 AM

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

#19 Rimi

Rimi

    Strip Me

  • +Clients
  • 6,121 posts

Posted 11 June 2012 - 12:34 AM

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

#20 kotaco

kotaco

    Advanced Member

  • +Clients
  • 233 posts

Posted 14 July 2012 - 12:56 PM

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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users