× Here you can get community support related to Tag Meta.

tablelookup empty wrong title etc.

  • ppeer
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
10 years 10 months ago #1209 by ppeer
tablelookup empty wrong title etc. was created by ppeer
For eg. the title i am using the macro {tablelookup} on lqm_id14=([0-9]+)/i{/tablelookup} - HuisX
When the value/number for lqm_id14 is non-existent in the table, TagMeta puts the number in place within the title, description and keywords, as you can see in the source of:

case1:
url 1

When lqm_id14 is identified in the table it is more like:

case2
url 2

My question: if the identifier is not found in the table (case 1), how to come up with the last two parts of the url (zuidbuurt-57,vlaardingen) , instead of the number (identifier) in the title, description and keywords?

regards,
Peter

case1:
url 1

When lqm_id14 is identified in the table it is more like:

case2
url 2

My question: if the identifier is not found in the table (case 1), how to come up with the last two parts of the url (zuidbuurt-57,vlaardingen) , instead of the number (identifier) in the title, description and keywords?

regards,
Peter

Please Log in or Create an account to join the conversation.

More
10 years 10 months ago #1212 by admin
Replied by admin on topic tablelookup empty wrong title etc.
The macro returns the key value if cannot return the column value. You need a "conditional" result, but at the moment there's no macro that allows to do this. I'm planning to add some basic ternary comparison macros, like:
(condition) ? <result if true> : <result is false>

In you case something like:
parts=<build the other parts of the URL>
result=<table lookup result>
use={is_integer ${parts},${result}}${result}{is_integer}

Kind regards,
Luigi

Please Log in or Create an account to join the conversation.

Time to create page: 0.081 seconds