Basically, I'm using the Aggregator module to import content from an RSS feed. The content is just a bunch of articles. I display this content in a view.

enter image description here

This is my current output, it shows the title and the date in a jcarousel. The thing I'm missing is the webpage source.

Currently, source url in views will have me a full link like:
From the above, all I want to display is:

Here are my view settings:
enter image description here

I have tried adding different types of fields but none of them see to return the right value. Is there any way to perhaps strip the whole source url down to the base of it? I was thinking maybe it could be done programmatically however I need someone to point me in the right direction.

1 Answer 1


A way to do this would be to override the proprocess function get the domain like this:

function MY_MODULE_preprocess_views_view_field(&$variables) {
  $field = $variables['field'];

  if ($field->field == 'MY_LINK_FIELD_NAME') {
    $url = $variables['field']->getValue($variables['row'])[0];
    $parse = parse_url($url);
    $variables['output'] = $parse['host'];

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.