Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new 'groupTpl' feature #121

Open
wants to merge 1 commit into
base: 2.x
Choose a base branch
from
Open

Conversation

davidpede
Copy link

What does it do?

Adds a new optional tpl parameter that wraps all tags with their relevant group details.

Believe I've kept this backward compatible. Group placeholders are available using group. prefix, tags are available under [[+tags]]. rowTpl and outTpl are unaffected.

Use like:

[[TaggerGetTags?
    &groups=`2,3,4,5`
    &groupTpl=`@INLINE <optgroup label="[[+group.name]]">[[+tags]]</optgroup>`
    &rowTpl=`@INLINE <option value="[[+uri]]">[[+tag]]</option>`
]]

Why is it needed?

Adds support for things like optgroup where you need the group placeholders and all the tags the group contains in one tpl.

@matdave matdave requested a review from theboxer December 14, 2020 23:17
@@ -262,12 +265,26 @@
}
}

$out[] = $tagger->getChunk($rowTpl, $phs);
if ($groupTpl == '') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

empty is a better check

}

$idx++;
}

if ($tagGroups != '' && $groupTpl != '') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

!empty for both

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants