Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Psib3r 70 posts 119 karma points
    Nov 07, 2011 @ 12:35
    Psib3r
    0

    Global terms

    Is there a way of having global terms in Umbraco?  For instance if I want to say we have 20 branches nationwide I want the 20 to be a global term that can be changed.

    I tried using a macro and some script to simply put the number in, but this annoyingly puts a line break above and below so I end with something like:

    We have
    20
    branches nationwide

  • Psib3r 70 posts 119 karma points
    Nov 07, 2011 @ 12:44
    Psib3r
    0

    In fact it splits the text, if it was in a paragraph tag, it closes it and re-opens it after the macro div, surely there must be another way, I am hoping this one small thing that is required will not stop me from using it?

    Also I think this forum is broken, I can't edit my post.

  • Rodion Novoselov 694 posts 859 karma points
    Nov 08, 2011 @ 06:20
    Rodion Novoselov
    0

    Hi. If I understand your question right you want to have something like a 'global setting' for your portal that can be easyly changed by a portal editor/administrator. If that's true there're two common approaches that I'm aware of:

    1) You can introduce a special document type dedicated completely to store your settings as fields. Then you put a document of this type to some fixed place in your content tree and when you need to get some setting you can extract it with API from this document.

    2) Also as another option you can introduce a special document type for your home page and store your settings in it. There're advantages in this approach since in practice these 'global variables' often used on all pages and it's often convenient to get them with a 'recursive' option of a <umbraco:Field> control.

  • Psib3r 70 posts 119 karma points
    Nov 08, 2011 @ 14:14
    Psib3r
    0

    The issue is not the storing, there are several ways of doing that, it's the displaying of the value inline as apposed to using a plugin/macro that splits the lines, a bit like the shortcodes package which would be ideal except I can't see any way of the editor of the pages adding their own.

  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    Nov 08, 2011 @ 14:20
    Ismail Mayat
    0

    you could do it using the dictionary only thing is you would only be able to use it in a template unless you create a macro for it that it can be used in rich text edit.

  • Anthony pj 40 posts 63 karma points
    Nov 08, 2011 @ 14:25
    Anthony pj
    0

    Is ther soem reason why you wouldnt include the whole section with your macro fro example

    "we have Yourvariable branches"

    to prevent the behavior you are experiencing or as Rodion suggested using <umbraco:field> control within the template of the page that displays the value

  • Rodion Novoselov 694 posts 859 karma points
    Nov 08, 2011 @ 14:30
    Rodion Novoselov
    0

    Afaik, there used to be some problems with displaying macros as inline elements in content in the older versions of umbraco, but they are fixed in the recent once. While editing the content the editor control shows a macro as a block DIV element (unfortunately it's by design), but on a live page it's going to be drawn as-is without a wrapping div. So if you use the version of umbraco at least not older than 4.7 there shouldn't be a problem with it.

  • Psib3r 70 posts 119 karma points
    Nov 08, 2011 @ 16:33
    Psib3r
    0

    Like Rodion said there is the problem with the DIV, so therefore it will always be on a seperate line and still not flow, it makes it too restrictive as well as I would have to write a seperate thing for each variation of how I wanted to display the information.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies