Gid or group_id

Hello,

I always get confused what LW uses to pull group id automatically in code? Is it gid, group_id or id? Here is an example of a code line?

<a href="https://news.iu.edu/live/json/news/group_id/{gid}/tag/{title_clean}">JSON</a>

Thanks,

Akbar

Sure thing Akbar – if you’re looking at a widget format (which is what I’m guessing based on the {curly brace} variable style), it looks like {gid} is used consistently across types.

If you ever need a reminder, you can use the /livewhale/?widgets_edit UI and click the buttons beneath the Format editor to have it populate in the corresponding variable name:

Hope this helps!

Hi Karl,

I am using gid only. But it does not pull anything. You can see it for JSON Feed URL here:

https://iu-news-dev.lwstory.com/iuglobal/tags/

For full context, the code is in a php file like this:

            <widget type="tags">
				<arg id="clean_markup">true</arg>
				<arg id="group">me</arg>
				<arg id="only_starred">false</arg>
				<arg id="format"><p><a href="%%xphp_group_directory%%/news/?tag={title_clean}">{title_clean}</a> - <a href="https://news.iu.edu/live/json/news/group_id/{gid}/tag/{title_clean}">(JSON Feed)</a> - <a href="https://news.iu.edu/live/rss/news/group_id/35/tag/{title_clean}">(RSS Feed)</a></p></arg>
            </widget>

Any guidance you could provide as to why it not pulling? I am trying to avoid hardcoding group ids.

Thanks,

Akbar

Ahh, the tags widget – that’s an odd case because it originally had one purpose (showing content by tag) and then a few years back we added a second purpose of “show me a list of tags” using <arg id="tag_list">true</arg> (docs). We’ll check this out and let you know what we discover.

Thanks Karl. I will continue using hardcoded group id.