CMS MADE SIMPLE FORGE

CMS Made Simple Core

 

[#9108] cms_selflink hrefonly / returnhref option to get only the url / href-value

avatar
Created By: Philonor (philonor)
Date Submitted: 2013-04-04 05:26

Assigned To:
Resolution: Invalid
State: Closed
Summary:
cms_selflink hrefonly / returnhref option to get only the url / href-value
Detailed Description:
See
http://forum.cmsmadesimple.org/viewtopic.php?f=21&t=65815&sid=4c4c174218313af7b53c1cc630925eb7

If the html markup produced by cms_selflink does not meet your requirements, you
should be able to write the html yourself and only get the href-value generated
by cms_selflink.

It seems that it's a simple hack in plugins/function.cms_selflink.php:
  if(isset($params['hrefonly']) && ((bool) $params['hrefonly'] === TRUE))
	$result = $url;
Righ before:
  if (isset($params['lang'])) cms_set_frontend_language();
  if( isset($params['assign']) ){
    $smarty->assign(trim($params['assign']),$result);
    return;
  }

  return $result;
}

(cmsms version: 1.11.5)

This makes it possible to write your own html markup (e.g. css image links):
<a href="{cms_selflink dir='next' hrefonly='1'}" title="Next page">
<span>Next page</span>
</a>

History

Comments
avatar
Date: 2013-09-18 00:39
Posted By: Robert Campbell (calguy1000)

{cms_selflink href=$some_page_alias}

      
Updates

Updated: 2014-03-14 23:31
state: Open => Closed

Updated: 2013-09-18 00:39
resolution_id: => 9