I want to be able identify specific posts by using the post SLUG rather than the post ID.
e.g. I'd like to be able to use
[wpv-post-title item='slug-of-post']
instead of
[wpv-post-title item='845']
but the Item Attribute does not allow for this.
In the worst-case scenario (Plan C), I can adjust my design to use Post IDs, but it's going to be MUCH easier to develop my application if I can use slugs. (I'll be creating a lot of posts with fields that refer to other posts and fields: when I get to populate those fields, I know from the context exactly what the slug is that I need to use. If I have to use IDs I'll have to ensure the post is created first before I can reference it, and go and find out what the ID is.)
Plan A is to double-check that I can't do this with built-in toolset shortcodes: that's the essence of what I'm asking here.
Plan B is to write my own shortcode to convert from slugs to IDs and then use those IDs in Toolset shortcodes. So - a subsidiary question I'm asking here is to ensure I'd not be trying to do something impossible!
Thanks!
Actually, I found it was very easy to write the shortcode to get the ID from the slug and post-type (Plan B).
So, unless I missed some built-in method using Toolset, I'm fine now.
Yes, I think a custom shortcode is your best bet here. There's nothing built-in to Toolset that will allow you to use slugs instead of IDs in the item attribute, as defined here: https://toolset.com/documentation/user-guides/views-shortcodes/item-attribute/
My issue is resolved now. Thank you!
Hello alexG-4. Can you tell me how did you do that?