As the Global Variables aren’t global (they don’t work in all parts of EE e.g. the wiki) is there a way that I can replicate the functionality, preferably getting something out of the exp_global_variables table in a way that the wiki will allow? I have some numbers, e.g. totals that affect 50 or so pages at a time and getting fed up with the admin overhead.
[Mod Edit: Moved to the Development & Programming forum]
wikitect,
Tried embedding it in a wiki page and it is not parsed - get the tag name as a literal text string.
Ah ok. No your global variable will not work here. What Lisa is referencing is the actual Wiki templates where global variables work fine.
Would adding your variable to one of these templates work in this instance for you?
No - I’m trying to solve the problem of repeated values (like constants or common snippets of text) in articles rather than page design. The trouble is these things will be tiny and be fragments so you wouldn’t want to see them listed with the other wiki pages.
Can I just embed php into a wiki page or is there anything I need to wrap it in?
There are two things going on here:
A wiki “entry” - that is when you go to the front-end and create a new article or edit an existing one. This content can not take PHP or EE tags.
The wiki theme - this is the design that goes through the template engine. You can use PHP and EE tags here, with the caveat mentioned by Brandon.
I’m not always sure if you’re referring to 1 or 2, hence some of the confusion. Sorry about that.
In which case I’m stuffed - it’s the wiki article where I’d like to make it more maintainable by having ‘constants’ wrt snippets of text in a single place, which I’m referring to i.e. 1)
Is it possible to create a plugin or similar for the wiki and have the wiki tag set extended by a plugin? If so, where would I find out about how to construct such a thing? It just seems sensible to be able to manage and reference static content centrally and this seems ripe for some extra functionality. It’s frustrating that it is there in the DB but cannot be accessed!
Ta
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.