1

Hello I created a sitemap with the modules "Views and data export". The sitemap of my page works fine, but I would add images to my page.

The sitemap should look at first capture, I do a test with figure and they are well placed. When I "rewrite the results" the tag is ignored. How to implement these label ? it's been weeks since I'm on it.

Thank you

If I replace the HTML tags with text data it works:

enter image description here

However when I add HTML it gets removed:

enter image description here


I found answers to How add markup and prefix / suffix for computed field. Can you tell me how to put that in place?

0

HTML tags, ugh, finally I understand your Q.

You can re-write your field using template files.

Go to /sites/all/themes/YourTheme/templates folder and

create views-view-fields--[view-name]--[machine-name].tpl.php

For Example:

If you view is called "Hello World" and the machine name is block_1

then it would be views-view-fields--hello-world--block-1.tpl.php

Inside your template file you put:

<?php

$fields["path"]->content = '<loc>' . $fields["path"]->content . '</loc>';

$fields["field_image"]->content = '<image:loc>' . $fields["field_image"]->content . '</image:loc>' . '<image:title>' . $fields["field_image-atl"]->content . '</image:title>';

echo $fields["path"]->content;
echo $fields["field_image"]->content;

When you are working with template files, remember to clear/flush the cache to see the changes.

Now your HTML tags should not get removed.

|improve this answer|||||
  • thank you for this information, but I have never done this. Can you give me more details on how to proceed? I posted a picture of the view in response – user60539 Apr 29 '16 at 16:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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