Views and template: links are node/X but not alias.

View: New views
4 Messages — Rating Filter:   Alert me  

Views and template: links are node/X but not alias.

by Michel Morelli :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all. I have a view where retrieve the last 10 blog post. I need to
retrieve this fields: title (linked to the blog post), post date, and
teaser. I have make the view and it works, but not at 100%.  The problem
is that the link in the title is "node/X" and not the alias created via
pathauto. Pathauto is configurated and running (alias for node/X works).
This is my template file
(views-view-fields--categoriespage-fitness.tpl.php):

<div class="AntNewsCategoria borderBottomCateg">
                                                <img height="63"
width="103" alt="image"
src="/sites/fitnesspeople.it/themes/fp_001/images/fotoAntepriNews.jpg"/>
                                                <h3><?php echo
$fields['title']->content; ?></h3>
                                                <p><span
class="data"><?php echo $fields['created']->content; ?> - <?php echo
$fields['teaser']->content;?></p>
</div>

Where is the problem ?

M.

--
Michel 'ZioBudda' Morelli                       michel@...
Sviluppo applicazioni CMS DRUPAL e web dinamiche (LAMP+Ajax)
Telefono: 0200619074
Telefono Cell: +39-3939890025 --  Fax: +39-0291390660

http://www.ziobudda.net                         ICQ: 58351764  
http://www.ziobuddalabs.it                      Skype: zio_budda
http://www.ziodrupal.net        MSN: michel@...                  
                                                JABBER: michel@...

--
[ Drupal support list | http://lists.drupal.org/ ]

Re: Views and template: links are node/X but not alias.

by KOBA | Hans Rossel-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Use global_redirect module if you would like to have always the node/x redirected to the alias.

Make sure the language of text items is set correctly otherwise pathauto will not work well. ie if you have only one language that is active in your site it's better to leave the language of all items as "language independant", check on /admin/content/node/overview what language your content has. Change to language independant if needed with the plugin http://drupal.org/project/languageassign.

Hans
www.koba.be


2009/11/4 Michel Morelli <michel@...>
Hi all. I have a view where retrieve the last 10 blog post. I need to
retrieve this fields: title (linked to the blog post), post date, and
teaser. I have make the view and it works, but not at 100%.  The problem
is that the link in the title is "node/X" and not the alias created via
pathauto. Pathauto is configurated and running (alias for node/X works).
This is my template file
(views-view-fields--categoriespage-fitness.tpl.php):

--
Hans Rossel
KOBA Webdesign bvba
Beukenlaan 56
9051 Gent (Sint-Denijs-Westrem)
Belgium
BTW 0817.931.516
+32.9.334.52.60
+32.472.79.32.16
www.koba.be
info@...

--
[ Drupal support list | http://lists.drupal.org/ ]

Re: Views and template: links are node/X but not alias.

by Michel Morelli :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks Hans. Now it works.

M.

--
Michel 'ZioBudda' Morelli                       michel@...
Sviluppo applicazioni CMS DRUPAL e web dinamiche (LAMP+Ajax)
Telefono: 0200619074
Telefono Cell: +39-3939890025 --  Fax: +39-0291390660

http://www.ziobudda.net                         ICQ: 58351764  
http://www.ziobuddalabs.it                      Skype: zio_budda
http://www.ziodrupal.net        MSN: michel@...                  
                                                JABBER: michel@...

--
[ Drupal support list | http://lists.drupal.org/ ]

Re: Views and template: links are node/X but not alias.

by Earnie :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, 04 Nov 2009 KOBA | Hans Rossel wrote:

> Use global_redirect module if you would like to have always the node/x
> redirected to the alias.
>

Caution if you're using xmlsitemap and install this module you will  
need to adjust the module weights for xmlsitemap to be after  
global_redirect.  Otherwise the sitemap.xml will contain links for  
both the alias and the src url.

--
Earnie
-- http://r-feed.com/           -- http://for-my-kids.com/
-- http://www.4offer.biz/       -- http://give-me-an-offer.com/


--
[ Drupal support list | http://lists.drupal.org/ ]