Root Admin Chewett Posted October 28, 2009 Root Admin Report Posted October 28, 2009 Copied From Murs initial Post (no code changed) Managing Content Sections In the content sections you put all text, stories, forms, templates, javascript and all things that are not MDScript code. Instead of putting all content in one big piece, you can separate it by placing a content separator, thats exactly this string: <!-- content separator --> All the pieces of content separated by such a separator, will be available for use in the MDScript under the @content array starting at index zero. Example: Content part 1 <!-- content separator --> Some other content <!-- content separator --> A template [[test]] with variables <!-- content separator --> A form <form ...> ... </form> This will be in the MDScript seen as: @content[0] = Content part 1; @content[1] = Some other content; @content[2] = A template ... with variables; @content[3] = A form <form ...> ... </form>; This way of separating content is very useful. You could display different content sections depending on different rules you set in the script. Also its very important when you use templates. Quote
Fyrd Argentus Posted July 10, 2010 Report Posted July 10, 2010 (edited) Isn't this a mistake? I think that Content part 1 <!-- content separator --> Some other content <!-- content separator --> A template [[test]] with variables <!-- content separator --> A form <form ...> ... </form> Would generate: @content[0] = Content part 1; @content[1] = Some other content; <-------------------This line got skipped. @content[2] = A template ... with variables; @content[3] = A form <form ...> ... </form>; Edited May 30, 2012 by Chewett Quote
Root Admin Chewett Posted July 10, 2010 Author Root Admin Report Posted July 10, 2010 Very good point, Mur must have been rather tired when he wrote this Fixed Quote
Maebius Posted May 30, 2012 Report Posted May 30, 2012 By the way, it's [b]<!-- content separator -->[/b] Not [b]<!-- content section -->[/b] That caused me some minor headaches earlier. Quote
Root Admin Chewett Posted May 30, 2012 Author Root Admin Report Posted May 30, 2012 altered all posts, thanks M Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.