Adding a more information link to the Service Links module.

I am not a developer, PHP is very much a foreign language to me but I need to add a link to more information about the services. Ideally I’d like to add something like the following code below the image links… but exactly where id goes, and how, are mysteries to me.

<a href="more-information#bookmark"/><em>what are these?</em></a>

The site is for less experienced web users and the client wants to help his readership into the wider web.

Many thanks

Comments

devin carlson’s picture

To do this, you've got a couple options.

The easiest way, if you are using the service links block, is to just create a new block, place it beneath the service links block and use the code you pasted as the block's body (make sure to give it a title of and to allow it to use Full HTML filtering).

Otherwise, you could place service links into your theme directly and just add your HTML below it.

For example, if you want to place service links in nodes, right below the node content:

Copy+paste the template.php file found in the service links module directory into your theme's directory (or the code from the service links template.php to your theme's template.php file if your theme already has a template.php file).

Open up node.tpl.php (if your theme has such a file, otherwise you'll need to create it) and paste <?php print $service_links ?> followed by the html code that you want, in your case <a href="more-information#bookmark"/><em>what are these?</em></a>, right below <?php print $content ?>

After you're done, your node.tpl.php file should end up looking something like this:

<div id="node-<?php print $node->nid; ?>" class="node<?php if ($sticky) { print ' sticky'; } ?><?php if (!$status) { print ' node-unpublished'; } ?> clear-block">

<?php print $picture ?>

<?php if (!$page): ?>
  <h2><a href="<?php print $node_url ?>" title="<?php print $title ?>"><?php print $title ?></a></h2>
<?php endif; ?>

  <div class="meta">
  <?php if ($submitted): ?>
    <span class="submitted"><?php print $submitted ?></span>
  <?php endif; ?>

  <?php if ($terms): ?>
    <div class="terms terms-inline"><?php print $terms ?></div>
  <?php endif;?>
  </div>

  <div class="content">
    <?php print $content ?>
  </div>

  <?php if ($service_links): ?>
    <div class="service-links">
      <?php print $service_links ?>
      <a href="more-information#bookmark"/><em>what are these?</em></a>
    </div>
  <?php endif;?>

  <?php print $links; ?>
</div>
mouse77e’s picture

http://drp.ly/13Sbbr
as you can see the icons are going vertically not horizontally in the block view - any ideas why? and how do i sort this out... i went for the block option for simplicity...

many thanks

devin carlson’s picture

Service links prints the links in a standard list by default, so you'll need to style them (with CSS) to get them to look like how you want.

I forget the exact HTML that service links outputs, but you'll want to do something like:

.service-links ul li {
  display: inline;
}