The l() function in Drupal 6 uses an $options array where you can pass a fragment.
'fragment' - A fragment identifier (named anchor) to append to the link. Do not include the '#' character.
To split the named anchor from your original URL you can use:
explode('#',$result->node_data_field_pager_item_text_field_url_value)
The code, including an if statement to check if the URL has a named anchor part,would become:
// add slide_read_more variable if (isset($result->node_data_field_pager_item_text_field_url_value)) { if (stristr($result->node_data_field_pager_item_text_field_url_value,'#')) { $split_url = explode('#',$result->node_data_field_pager_item_text_field_url_value); $slider_items[$key1]['slide_read_more'] = l('Read more...', $split_url[0], array('fragment' => $split_url[1],)); } else { $slider_items[$key1]['slide_read_more'] = l('Read more...', $result->node_data_field_pager_item_text_field_url_value); } }
Also have a look at the related how to: How to link Read more... button to another page instead of the node
Recent comments
1 min 30 sec ago
2 days 5 hours ago
2 days 7 hours ago
3 days 21 hours ago
4 days 14 hours ago
5 days 6 hours ago
5 days 13 hours ago
1 week 17 hours ago
1 week 2 days ago
1 week 4 days ago