Jump to content

Managing Content Sections


Chewett

Recommended Posts

  • Root Admin

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.

Link to comment
Share on other sites

  • 8 months later...

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 by Chewett
Link to comment
Share on other sites

  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Forum Statistics

    17.5k
    Total Topics
    182.5k
    Total Posts
  • Recently Browsing

    • No registered users viewing this page.
  • Upcoming Events

    No upcoming events found
  • Recent Event Reviews

×
×
  • Create New...