Skip to content
View in the app

A better way to browse. Learn more.

MagicDuel Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Managing Content Sections

Featured Replies

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

  • 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

  • 1 year later...

By the way, it's
[b]<!-- content separator -->[/b]

Not
[b]<!-- content section -->[/b]


That caused me some minor headaches earlier. :D

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

Forum Statistics

  • Total Topics 17.5k
  • Total Posts 182.2k

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.