Page Link

sbarre5's Avatar

sbarre5

02 Apr, 2015 05:22 PM

I can't seem to get the link on a page chooser to render the page properly.

Velocity:

#set ($search = $_XPathTool.selectSingleNode($contentRoot, '//system-data-structure/menu-settings'))
   #if ($includeSearch == "Yes")
      #set ($searchResults = $search.getChild("search-results-page"))
      #set ($searchResultsPage = $searchResults.getChild("path").value)
      <li class="search-button-wrap"><a href="#" class="search-button" id="search-button"><span class="fa fa-search"></span></a>   </li>
      #searchincluded
   #end


#macro(searchincluded) <div class="nav-box search" id="nav-box">
<form action="${searchResultsPage}" id="form-search" method="get" name="searchForm"> <label><input autocomplete="off" class="input-medium" id="q" maxlength="2048" name="q" placeholder="Search This Site" type="search" /></label> <button type="submit" formaction="#" class="btn"><span class="fa fa-search"></span></button> </form> </div> #end

HTML Output - cleary /search doesn't work:

   <form action="/search" id="form-search" method="get" name="searchForm">
      <label><input autocomplete="off" class="input-medium" id="q" maxlength="2048" name="q" placeholder="Search This Site" type="search"></label>
      <button class="btn" type="submit"><span class="fa fa-search"></span></button>
   </form>
  1. 1 Posted by Ryan Griffith on 02 Apr, 2015 08:19 PM

    Ryan Griffith's Avatar

    Hi,

    Is the page being selecting within the chooser within a different Site by chance? If it is, use the link element instead of path to generate a cross-Site link:

    #set ($searchResultsPage = $searchResults.getChild("link").value)
    

    If the selected page is within the same page, try surrounding the value of the path with [system-asset] pseudo tags to force Cascade to track the link:

    <form action="[system-asset]${searchResultsPage}[/system-asset]" id="form-search" method="get" name="searchForm">
    

    Site note: Either way, I would suggest using link in the event the chosen page does end up being within another Site.

    Please let me know if you have any questions.

    Thanks!

  2. Ryan Griffith closed this discussion on 20 Apr, 2015 02:26 PM.

Discussions are closed to public comments.
If you need help with Cascade CMS please start a new discussion.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

 

26 Aug, 2016 01:19 PM
25 Aug, 2016 03:02 PM
25 Aug, 2016 12:50 PM
24 Aug, 2016 08:43 PM
24 Aug, 2016 07:20 PM
21 Aug, 2016 01:20 PM