XF 2.1 Where can I learn about Template Macros

ibaker

Well-known member
I can edit and transform the previous XF html templates and css into exactly what I want but in v2 the basic html templates have have been "pollutted" with things called "Macros" and seems to double up the template to me. These Macros seem to interfere in using basic html when I look at a template which puts "me" right off trying to do anything as I just get so confused. So, where can I go to learn what the XF Macros in the templates do and how to use them without all the developer jargon which will turn my learning curve into a mountain...thanks for your "common English" advice
 
Not very complete though. Like this:

Code:
            <xf:macro name="custom_fields_values"
                arg-type="{$type}"
                arg-group="{$group}"
                arg-set="{$set}"
                arg-onlyInclude="{$onlyInclude}"
                arg-additionalFilters="{$additionalFilters}"
                arg-valueClass="{$valueClass}" />
No explanation of arg-type, arg-group, etc.. I need to know what arg-onlyInclude and arg-additionalFilters does, what values they expect (string? array?), etc.. I'm making do by working around it but it's a kludge. I'm trying to pull out one custom field from many in an add-on I downloaded, and not getting anywhere.
 
I'm having trouble with this too. Actually - looks like I'm in a very similar boat Wildcat Media,

Currently trying to create a custom version of

<xf:macro template="custom_fields_macros" name="custom_fields_edit" arg-type="users" arg-group="contact" arg-set="{$xf.visitor.Profile.custom_fields}" />

from the settings page, so I can split up all my custom fields into more organised sections.

I'm guessing I can use the onlyInclude argument, but it's not working with any values I put in and I can't find anything about these in the docs.

Would be nice if there was better documentation on stuff like this and filters.

Edit: Finally got part of it working after hunting around the templates for examples from elsewhere.
 
Last edited:
They do have good basic documentation on how XF works, but this sort of in-depth documentation is lacking. But I can't blame them--if they're having to write documentation for every little bit of code, that's time they can't be coding the next version. There are some good bits buried in the many threads in the forum, but it can take a while to find them (if they are even present). And part of my problem is that many years ago, I burned out on coding, and my memory is no longer what it used to be, so for me to jump in head-first to learn all this simply won't happen.

I have to cannibalize other templates myself in order to figure out how things work. Usually I just give up, after I convince myself whatever new feature I wanted really wasn't that important in the long run.
 
Top Bottom