Jump to content

IPB 3.0: Templating Discussion


Guest BryanH

Recommended Posts

Posted
http://forums.invisionpower.com/index.php?...;showentry=2385

Sounds great! Removing the template bits and replacing them with a single file for each "view" is a MUCH better idea! I'm glad we're moving in that direction.

I don't really understand the template tags quite yet. I was hoping they'd be like short code for dynamically displaying certain content across all the templates. Something simpler, like the code in the header/footer wrappers. <% POST_TITLE %> for displaying the post title, <% POST_AUTHOR %> <% POST_CONTENT %> <% POST_DATE %>
<% FORUM_TITLE %> something like that. Or is that what you're shooting for?
Posted

You could discuss this in the blog comments as well, But ohh well.

Don't worry lots of us don't understand the tags yet since we didn't try them and read a good explanation about the usage of them.
About the <% %> tags around the board, doing what you asked for is not that simple as it sound since the content changes and varies from page to page.

Posted
http://forums.invisionpower.com/index.php?...;showentry=2385

Sounds great! Removing the template bits and replacing them with a single file for each "view" is a MUCH better idea! I'm glad we're moving in that direction.



I don't really understand the template tags quite yet. I was hoping they'd be like short code for dynamically displaying certain content across all the templates. Something simpler, like the code in the header/footer wrappers. <% POST_TITLE %> for displaying the post title, <% POST_AUTHOR %> <% POST_CONTENT %> <% POST_DATE %>


<% FORUM_TITLE %> something like that. Or is that what you're shooting for?



You can already edit the data variables and have things like {$post['title']}, {$post['starter_name']} etc
Posted

i would like to see alot of things made much more simplier than they currently are however it seems things are going in the way of more complicated, sure this is great because we get more to work with but there is a thing such as too much. for example the new url tabs are way over complicated and i say that currently the language file identifiers are more complicated than they should be. I feel that in relation language calls will change again and not necessarily in the way of ease.

Posted

What would make the url tag easier?

//Side note - the reason the syntax is different (i.e. {%url%} instead of <url>) is because it is a template plugin and not a built in function, but that's relatively minor

What would make language file calls easier?

Posted

Now is the time to suggest things that would make it easier :)



I've suggested stuff in the past that I thought was going into the template so correct me if I am wrong. But we are going to have the ability to re-save a template as the original right? By this I mean, there will be an option to save it as if no changes were made to any of the template bits even if there were changes made to it (ie: maybe a bug in the skin that had to be fixed and don't want to revert the change next time something else is tried).
Guest Zachary Stoler
Posted

Now is the time to suggest things that would make it easier :)


The ability to use BBCode in templates for newbs ;)
Posted

Well it will be easier for people who have programmed for a while, but going to be a nightmare for me. The eway things are going to be set up I guess i would have to go through thousands of lines of coding changing things and then having to look up what I ened to even change so it will take forever since it's not simply replacements of function names.

I am not necessarily talking about templating though, as most of the hard part will be changing thigns in files since these new allowed things in templates don't "have" to be utilized.

Posted

While syntaxually long, XSL has it right (aka makes the most sense) in regards to adding attributes on to a tag.

Example:

<xsl:comment>You can also hardcode if you like....</xsl:comment>

<a class="coolClassName">

	<attribute name="href">{$phpvar}</attribute>

	<attribute name="title">{$phpvar}</attribute>

	<attribute name="onclick">{$phpvar}</attribute>

</a>



Considered with some of the examples that I gave to josh and brandon a few weeks ago on template management, the benefits of using an existing language (and PHP's XSLT parser or making your own based on use of DOM) over making your own are huge ;)

Links to mentioned example:
http://kevin.metalaxe.com/exampleApp/xmltemplates.php
http://kevin.metalaxe.com/exampleApp/xmltemplates.php?source
http://kevin.metalaxe.com/exampleApp/example.xsl

Still working on making time to show a XML only example (non-xsl based) and both XML or XSL based use of IPB's current "HTML logic" stuff.

P.S. Yes Brandon, I know "time", etc. But, given the discussion, I wanted to post the suggestions in a tangible location as well :) Besides, it doesn't hurt to suggest regardless of time ;)

Posted

<lang.name.file> thats easy, sort of the going the js way of chaining stuff but i'm not sure how the current language file calls will work going on the way everything else is working it could end up being something like:

$this->registry->get( ''file' )->getLang( 'langkey' );

i guess we can accept this in the php file but its going to get way overcomplicated in templates and could result in people trying to simplify this up by doing:

$lang = $this->registry->get( ''file' );

in template files:

$lang->getLang( 'langkey' );

which yes makes it shorter and easier to use but means that it could end up meaning theres no consistancy between files e.g.

Mr X Mods:

$mrlang = etc

ips default:

$ipslang = etc.

If you see my point. Remember all that is a example and as will 99% of people i still don't know how the new language system will work...

Posted

<lang.name.file> thats easy, sort of the going the js way of chaining stuff but i'm not sure how the current language file calls will work going on the way everything else is working it could end up being something like:



$this->registry->get( ''file' )->getLang( 'langkey' );



i guess we can accept this in the php file but its going to get way overcomplicated in templates and could result in people trying to simplify this up by doing:



$lang = $this->registry->get( ''file' );



in template files:



$lang->getLang( 'langkey' );



which yes makes it shorter and easier to use but means that it could end up meaning theres no consistancy between files e.g.



Mr X Mods:



$mrlang = etc



ips default:



$ipslang = etc.



If you see my point. Remember all that is a example and as will 99% of people i still don't know how the new language system will work...



Some of the more common calls have shortcuts setup in the constructors

$this->lang->words[ key ]

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...