Jump to content
Server Maintenance This Week. ×

Tokens driving me mad


This topic is 8585 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I have a problem understanding tokens and was wondering whether anybody could demystify this technique for me.

I am passing the following url,

FMPro?-db=contentindex.fp5&-lay=table&-format=channelhome.htm&pubdateconf=1&sitechannelid=1&-sortfield=pubdate&-sortorder=ascending&-max=10&-find

to access a set of records that are returned between the FMP-record tags shown below.

[fmp-record][FMP-if:contenttypeid.eq.1]<A href="[FMP-linkrecid:Format=channeleditorial.htm]">[fmp-field:headline]<br></a>[/fmp-if][/fmp-record]

You'll see that I'm using the dynamic FMP-linkrecid as I wish to access the full record. However, herein lies my problem as it sits in another database called news.fp5. The common link between the two is the contentID. However, when I try to pass this as a token the resulting page doesn't show the record content at all as it is still addressing the contentindex.fp5 contained in the original request.

How do I get it to address the news.fp5 and produce a set of dynamic links for all records returned from the orginal url search?

Any help would be appreciated as I am slowly going mad! Thanks.

Link to comment
Share on other sites

Forget using tokens for this purpose. Besides, nowhere in the cdml that you posted is there a command that sets a token.

You need to work on the link that takes people to the next database. The LinkRecID tag is inappropriate here because this CDML tag assumes the records are in the current database. You need the [FMP-Link] tag because it lets you change all of the specifics.

It should be:

[FMP-Link:dra] where d=database , r=format file and a=action

I have had some difficulties getting this Link tag to work correctly. It seems to be particular about the order that things are specified. (Check the page source to see exactly what url it is generating and modify the syntax of the Link tag accordingly.) For instance the syntax:

[FMP-Link:dra]&-db=news.fp5&-channeleditorial.htm&-find

...might not work correctly because the tags aren't in the correct order, but it might. If it doesn't work try this syntax:

-db=news.fp5&-[FMP-Link:dra]&-channeleditorial.htm&-find

All I have done there is recreate the standard url order.

Link to comment
Share on other sites

Thanks Vaughn that was a great help. As you suggest it is a little tricky to get it to work.

It would seem that the parameters that you wish to exclude from the original URL have to be in the same order as the request that originated the page and the new request. I also noticed early on that FMP was adding in a -Skip parameter which was definately not in my original URL, so to be safe I also excluded everything I wasn't using and ended up with the following:

[fmp-record]

[FMP-if:contenttypeid.eq.1]<A href="[FMP-link:dlrfsktma]-db=news.fp5&-lay=relatedstoriessummary&-format=editorial.htm&contentid=[fmp-field:contentid]&-find">[fmp-field:headline]</a>[/fmp-if]

[/fmp-record]

Including the contentID field in the find meant that I always end up at the correct record in the other database. CurrentRecID would not work as there is no guarantee that the number would be the same across databases.

Link to comment
Share on other sites

This topic is 8585 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.