Hi Phil,
I am having a problem with a tag being output on screen from the REST module and I was hoping you could help me sort out the cause.
Here’s my template code:
{exp:rest url="http://media.lpb.org/pbcore/api/GetAssetDetails.ashx" verb="get" format="xml" param:asset_identifier="{segment_3}" parse="inward"}
<!DOCTYPE HTML> <html> <head> <meta charset="utf-8"> <title> {if ErrorMessage} Error {if:else} {if IsPublic == "False" AND logged_out} Login Required {if:else} {exp:switchee variable = "{AssetType}" parse="inward"}
{case value="Segment"} {segmentTitle} {/case}
{case value="Episode"} {seriesTitle} {episodeTitle} {/case} {case value="Program"} {programTitle} {/case} {case value="Element"} {rawFootageTitle}{if seriesTitle} : {seriesTitle}{/if} {/case} {case value="Clip"} {clipTitle}{if seriesTitle} : {seriesTitle}{/if} {/case} {case value="Project"} {projectTitle} {/case} {case value="Series"} {seriesTitle} {/case} {case value="Collection"} {CollectionName} {/case} {case value="Topic"} Topic? {/case} {/exp:switchee} {/if} {/if} : Louisiana Digital Media Archive
</title> <meta name="keywords" content="{meta_keywords}"> <meta name="description" content="{meta_description}">
{headItems} [removed][removed] </head> <body class="homePage">
{layoutHeader} <div class="container-fluid mainWrapper"> <div class="row-fluid"> <div class="span8 mainColumn"> <article> {if ErrorMessage} <h1>Error</h1> <p>{ErrorMessage}</p> {if:else} {if IsPublic == "False" AND logged_out} <h1>Login Required</h1> <p>You must be logged in to view this entry</p> {if:else} {exp:switchee variable = "{AssetType}"}
{case value="Segment|Episode|Program|Element|Clip"} <div class="row-fluid"> <div class="span9"> </div> <div class="span3 assetCollectionLogo"> {Collection} {if CollectionName == "LPB"} <a href="#"><img src="/assets/images/lpb_collectionLogo.png" /></a> {/if}
{if CollectionName == "Louisiana State Archives"} <a href="#"><img src="/assets/images/archive_collectionLogo.png" /></a> {/if} {/Collection} </div> </div> {if "{IsDigitized}" == "True"} <div id="videoBlock"></div> [removed] jwplayer("videoBlock").setup({ file: "{FormatLocation}", width: "100%", aspectratio: "4:3" }); [removed] {if:else} <div class="blackPanel"> <h2>This asset has not been digitized.</h2> <p>You can help make this video available by sponsoring the digitization of this media item.</p> <a href="#" class="btn btn-purple">Click Here to Sponsor this Asset</a> </div> {/if} {/case} {case value="Project"} {projectTitle} {/case} {case value="Series"} {seriesTitle} {/case} {case value="Collection"} {CollectionName} {/case} {case value="Topic"} Topic? {/case} {/exp:switchee} {/if} {/if} </article> </div> <div class="span4 sideBar"> {embed="embeds/blogSpotlight"} </div> </div> </div><!-- /mainWrapper --> {layoutFooter} {scripts} </body> </html>
{/exp:rest}
to view the rendered template go here: http://ldma.lpb.org/video/asset-detail/LSWI-3201-Guard
To view the XML data REST is pulling, go here: http://www.odysseydesignstudio.com/ldmatest/LSWI-3201-Guard
I’m not sure why, but I’m seeing the {Collection} tag getting output when it definitely shouldn’t be. What is strange is it doesn’t render if I remove the parse inward parameter from the Rest tag, but if I remove that then the Switchee tags don’t parse at all.
Any insight you could give on how to solve this would be helpful. I suppose I could remove the Switchee code and the parse tag and do everything with regular conditionals, but I was hoping to find a way to use Switchee without removing it. I also tried some of the other looping tags from the xml like the {Contributors} loop and it worked fine with no strange tag output.
Thanks,
Brian
|