daily pastebin goal
69%
SHARE
TWEET

Untitled

a guest May 16th, 2018 120 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!-- RadiantCMS snippet using the BackDoor extension -->
  2. <!-- regex on the content of the <r:url /> tag for alternative language link -->
  3.  
  4. <r:erb_tag name="langLink" >
  5. <!-- defining the langLink tag -->
  6.   <r:erb>
  7.     <!-- commented to prevent the tag contents being printed -->
  8.     <!--  <%= url = <r:expand tag="url" /> %> -->
  9.     <%= if (/\/en/.match(url))
  10.       url.sub(/\/([^\/]+)/,"/ja")
  11.     else
  12.       url.sub(/\/([^\/]+)/,"/en")
  13.     end %>
  14.   </r:erb>
  15. </r:erb_tag>
  16. <!-- calling the langLink tag -->
  17. <r:langLink></r:langLink>
  18.  
  19. <!-- eg for a url /ja/some/path/ this will produce /en/some/path/ -->
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top