funtooosh

Using template tags within entry and page forms respectively

Vote 0 Votes
Hey there, I used to use tags from within entries and pages in good old MT4, however, I can't seem to recreate the same behaviour with MT6. For instance, when I copy into a page body form, it will render the tag rather than include the module :-( Or am I missing sth., are any preferences or prerequisites required, to make tags work from within pages? Cheers, -F

7 Replies

| Add a Reply
  • Ups, my tags got lost, this is what I wanted to write:

    I used to use tags from within entries and pages in good old MT4, however, I can't seem to recreate the same behaviour with MT6. For instance, when I copy (div class="filmliste")($mt:Include module="liste-spielfilme"$)(/div) into a page body form, it will render the tag ($mt:Include module="liste-spielfilme"$) rather than include the module :-(

  • Hi Funtoosh,

    I would assume that what you're trying to do is to add some MT tags inside entries or pages.

    That was possible only by using the "Process Tags" plugin from:
    https://plugins.movabletype.org/process-tags/

    As you could read on the above page comments, since movable type v4.2 you may like to consider using the mt:Eval template tag modifier.
    https://movabletype.org/documentation/appendices/modifiers/mteval.html

    On the other hand, when I need to insert say a form inside a specific Entry or Page, I could easily do it from the archiving template.

    Let's say that you want to add a form to the Entry ID 7.

    You could add this coding to the "Entry" archiving template:

    <mt:If tag="EntryID" eq="7"><mt:Include module="My form"></mt:If>

    Alternatively, when you have multiple IDs, you could either use the like parameter, like this:

    <mt:If tag="EntryID" like="(1|5|7)"><mt:Include module="My form"></mt:If>

    (the disadvantage being that also "13" or "21" are like "1", so your form could appear also on other places that were you wanted)

    Or even better you could tag the entries where you want your form to show up with say this sticky tag "@form" and you could display the form by adding to the "Entry" archiving template this coding:

    <mt:EntryIfTagged tag="@form"><mt:Include module="My form"></mt:EntryIfTagged>

    Hope it helps!

    Kind Regards,
    Mihai Bocsaru

  • Hi Micai,
    you're right, of course, putting the includes into page templates is the best and most professional way to achieve this. That's what I've done for now, too.
    However, if I want to quickly add chunks of generated content to pages, it is cool to have the old feature.
    I can't remember if I used process-tags or mt:Eval before, but thanx for pointing me there, looks exactly like what i want!
    Best,
    -F

  • Damn, I just found that I did already use the mteval attribute in my old templates .-)

  • Are you saying that the mt:Eval function doesn't work for you?

    Send me access to your MT admin via email and I could check.

    Thanks,
    Mihai

  • Oh, no, I was quite unclear, I guess: I had already used mteval two years back in an old template with MT4.3, but when I built a new iteration of the site with MT6.1 and new templates, I overlooked the mteval and forgot to copy that. Does work now!

  • Oh, I see. I was wondering how come it wouldn't have worked. Glad that the problem is solved.

Add a Reply

Forum Groups

Movable Type

1 12

Last Topic: Uploading Assets in Entry/Page by Michael Webster on Mar 2, 2015

3 9

Last Topic: Making breadcrumbs by SportsterPaul on May 24, 2017

Documentation

Be the first to post a topic in this forum

Performance

Be the first to post a topic in this forum

Pricing and Licensing

Be the first to post a topic in this forum

Product Ideas

Be the first to post a topic in this forum