Using tell a friend with ’pages’ URL’s?
Posted: 10 November 2007 11:43 PM   [ Ignore ]  
Summer Student
Total Posts:  16
Joined  08-02-2007

Footer code right now is this:

<div id="footer">
  <
p>
    
  </
p>
  <
p>
   
{exp:weblog:entries weblog="dsfcontent|news|exhibitors|speakers|press|pc" limit="1"}
    {if segment_1
=="site"}&nbsp;<!-- <a href="{title_permalink=site/friend_blog}">Email Page</a> -->
    
{if:else}<a href="{permalink=site/friend}">Tell a friend</a>{/if}
  {
/exp:weblog:entries}
  
</p>
  <
p>&copy; Copyright 2007 Direct Selling Festival</p>
</
div>

If I return the commented out code, the link it returns is this:

http://directsellingfestival.com/index.php/vivandi_group1/

i.e. the last entry into the system. And on a single entry:

http://directsellingfestival.com/index.php/amega_global/

i.e. its missing site/template

Profile
 
 
Posted: 11 November 2007 02:04 AM   [ Ignore ]   [ # 1 ]  
Summer Student
Total Posts:  16
Joined  08-02-2007

This is driving me bonkers. I’ve changed the footer so both links use {permalink} to point to the template.

I thought I’d try using the {comment_url_title_auto_path} in the tell_a_friend form.  In the exhibitors weblog I set the path as:

http://directsellingfestival.com/index.php/site/exhibitorlist/

So, results are: the link works when on a individual entry (which uses the template exhibitorlist), but for the list of links to an individual entry, I am still getting the wrong URL, i.e:

http://directsellingfestival.com/index.php/site/exhibitorlist/vivandi_group1/

Which is logical, because I have specified an incorrect template for accessing the links (should be exhibitorlist_links). The addition of the last entry title to the end of the url is also not needed.

You can see the page this is happening on here: http://directsellingfestival.com/index.php/site/exhibitorlist_links

So, do I need another if statement in my footer, and another tell_a_friend form? If so, how would I construct an if/ifelse/else statement and how would I make sure the url was site.com/index.php/site/weblogtemplate?

Profile
 
 
Posted: 12 November 2007 11:02 PM   [ Ignore ]   [ # 2 ]  
Summer Student
Total Posts:  16
Joined  08-02-2007

Bump for help.

Profile
 
 
Posted: 13 November 2007 08:43 AM   [ Ignore ]   [ # 3 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  24513
Joined  05-20-2002

What happens if you use:

{exp:weblog:entries limit="5" weblog="dsfcontent|news|exhibitors|speakers|press|pc"}
{if page_url}
<a href="{page_url}">Tell friend about page</a><br>{/if}
{if page_url
== ""}<a href="{title_permalink="site/tell"}">Tell friend</a><br>{/if}
  {
/exp:weblog:entries}

This works correctly on my site- note the limit ‘5’- I suspect it’s not a problem with the page url but with the embedding.  But I’m not sure.  This should give us a hint.

And the thread’s been split- so I can’t remember if you have a test page we can look at to see this in action.  If you do- a link would be helpful.

 Signature 

AKA rob1

Help Request TipsPro Network

Profile
 
 
Posted: 15 November 2007 12:31 AM   [ Ignore ]   [ # 4 ]  
Summer Student
Total Posts:  16
Joined  08-02-2007

Sorry, I wasn’t notified about a reply / thread split.

Live page

Example page - Newly made

The footer is embeded into the page using: {embed=“includes/.footer_test” entry_id=”{entry_id}”}

The embed contains a copy/paste of what you posted with site/tell changed to site/friend (my tell a friend form). It results in:

Static page:

Link = Tell friend about page; it links back to itself

Weblog page, listing all entry links:

5 links of “Tell a friend” with the url: http://directsellingfestival.com/index.php/site/friend/{title}
Links are the last 5 entries posted to the site in all weblogs.

Weblog page, looking at an entry:

1 link of “Tell a friend” with the url:
http://directsellingfestival.com/index.php/site/friend/{title}
Link is the title of that entry.

The actuall tell a friend from has now has {page_url} / {permalink} / {title_permalink} so you can see the results for each of them.

Profile
 
 
Posted: 15 November 2007 08:42 AM   [ Ignore ]   [ # 5 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  24513
Joined  05-20-2002

OK- let’s look at the example page- is the footer embed nested inside a weblog tag?  It must be, if you’re passing the entry_id- can you show me how that works- paste the tag around the embed.  Then change the footer back to:

{exp:weblog:entries limit="5" weblog="dsfcontent|news|exhibitors|speakers|press|pc" entry_id="{embed:entry_id}"}
{if page_url}
<a href="{page_url}">Tell friend about page</a><br>{/if}
{if page_url
== ""}<a href="{title_permalink="site/tell"}">Tell friend</a><br>{/if}
  {
/exp:weblog:entries}
 Signature 

AKA rob1

Help Request TipsPro Network

Profile
 
 
Posted: 20 November 2007 01:21 AM   [ Ignore ]   [ # 6 ]  
Summer Student
Total Posts:  16
Joined  08-02-2007

Hey Robin, I appreciate the time you are taking to help with this.

The reason entry ID was in there was from another suggestion in the previous thread. The footer is not nested in an entries tag:

</div><!-- close:page_wrapper -->
  
{embed="includes/.footer_test" entry_id="{entry_id}"}  
</body>
</
html>

When you say paste the tag around the embed… what tag? The entries tag with the weblog listed? I’ll assume so; so footer embedded with the following:

</div><!-- close:page_wrapper -->
  
{exp:weblog:entries limit="5" weblog="dsfcontent|news|exhibitors|speakers|press|pc" entry_id="{embed:entry_id}"}
   {embed
="includes/.footer_test"}  
  {
/exp:weblog:entries}
</body>
</
html>

& footer_test:

<div id="footer">
<
p>
  
{if page_url}<a href="{page_url}">Tell friend about page</a><br>{/if}
  {if page_url
== ""}<a href="{title_permalink="site/tell"}">Tell friend</a><br>{/if}
</p>
</
div>

This results in no footer at all.  Changed footer_test to:

<div id="footer">
<
p>
  
{exp:weblog:entries limit="5" weblog="dsfcontent|news|exhibitors|speakers|press|pc" entry_id="{embed:entry_id}"}
   {if page_url}
<a href="{page_url}">Tell friend about page</a><br>{/if}
   {if page_url
== ""}<a href="{title_permalink="test/friend"}">Tell friend</a><br>{/if}
  {
/exp:weblog:entries}
  
</p>
</
div>

Result: no footer. Changed the embed-code to:

</div><!-- close:page_wrapper -->
  
{exp:weblog:entries limit="5" weblog="dsfcontent|news|exhibitors|speakers|press|pc"}
   {embed
="includes/.footer_test"}  
  {
/exp:weblog:entries}
</body>
</
html>

Result: footer but no links. Nesting the embed-code in an entries tag is just duplicating the footer div, so, version on the example page (See it here) as it is up now:

Embed code:

</div><!-- close:page_wrapper -->
  
{embed="includes/.footer_test"}  
</body>
</
html>

.footer_test code:

<div id="footer">
<
p>
  
{exp:weblog:entries limit="5" weblog="dsfcontent|news|exhibitors|speakers|press|pc"}
   {if page_url}
<a href="{page_url}">Tell friend about page</a><br>{/if}
   {if page_url
== ""}<a href="{title_permalink="test/friend"}">Tell friend</a><br>{/if}
  {
/exp:weblog:entries}
</p>
</
div>
Profile
 
 
Posted: 20 November 2007 09:43 AM   [ Ignore ]   [ # 7 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  24513
Joined  05-20-2002

OK- I THINK what’s going on is- the tell-a-friend link should be for EACH entry.  Normally, on a multi-entry page, you could include on for each entry shown, no problem.

But- what you want to do is have a single ‘tell a friend’ link at the bottom of a multi-entry page.  At least- that’s what I gather from the sample here:
http://directsellingfestival.com/index.php/test/exhibitorlist_links

Each one of the exhibitor links shown on that page is an entry- correct?  And it links to the ‘single entry page’ where just that article is shown.  Correct?

And in the footer- you end up with 5 tell-a-friend links- each one linking to the tell-a-friend page for each of the first 5 articles.  Which- makes sense, because you can’t have a single link to a tell-a-friend page for a multi-entry page.  You have a link to a tell-a-friend for EACH of the entries, not a single link for ALL of the entries.

I think that’s the problem.  You really can’t logically have a tell-a-friend link for the entire multi-entry page.  Only a link for a single entry on that page.  In other words- the ‘tell a friend’ link in the footer isn’t going to work for multi-entry pages, because there’s no way to know which one single entry it should link to.

That make sense?

 Signature 

AKA rob1

Help Request TipsPro Network

Profile
 
 
Posted: 20 November 2007 11:42 PM   [ Ignore ]   [ # 8 ]  
Summer Student
Total Posts:  16
Joined  08-02-2007

You’re correct on all your assumptions! Also, it does make sense.

Given that, I need three types of links:

1. Pages Module pages (sorted this using page_url)
2. ‘index’ pages (like exhibitor_links) which have the links to full entries
3. ‘entry’ pages (can do this using the {comment_url_title_auto_path})

How would I then go about pulling the URL for number 2 and 3, and further - doing it all in one footer with an if then (but please) statement. Especially for number 2… do I need to make a separate tell/friend template for each ‘index’ page with the link hard coded?

Profile
 
 
Posted: 25 November 2007 01:03 AM   [ Ignore ]   [ # 9 ]  
Summer Student
Total Posts:  16
Joined  08-02-2007

Any ideas?

Profile
 
 
Posted: 25 November 2007 08:51 AM   [ Ignore ]   [ # 10 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  24513
Joined  05-20-2002

You really can’t natively link to a ‘tell-a-friend’ for a multi-entry page- i.e., #2 above.  The tell-a-friend only shows the info/link to one entry in the email- it won’t automatically recreate a multi-entry page.  So- you’d want a conditional in the footer so that the ‘tell’ link only shows when you’re on a single entry page.  I’m not totally up on your site structure, so I can’t say what the conditional should look like.  You could likely create it based on segment 2- if some templates are only for single entry pages and others only for multi-entry.  But basically?  You need to not show the link on multi-entry pages, because it won’t work.  For 1&3;- it should be easy to show the link, just use the conditional logic above- where if there’s a pages url, it uses that, otherwise it uses the comment url auto path.

Make sense?

 Signature 

AKA rob1

Help Request TipsPro Network

Profile
 
 
Posted: 25 November 2007 11:20 PM   [ Ignore ]   [ # 11 ]  
Summer Student
Total Posts:  16
Joined  08-02-2007

Alright, well we got to an answer in the end smile

Robin, I appreciate all your help getting there.

Profile
 
 
Posted: 26 November 2007 08:54 AM   [ Ignore ]   [ # 12 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  24513
Joined  05-20-2002

Sorry it wasn’t exactly what you were wanting to hear.  But yep- the multi-entry pages are just a ‘no go’ with the stock ‘tell-a-friend’.  Glad we figured out what was up, though.

 Signature 

AKA rob1

Help Request TipsPro Network

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 77568 Total Logged-in Users: 43
Total Topics: 101557 Total Anonymous Users: 26
Total Replies: 544401 Total Guests: 263
Total Posts: 645958    
Members ( View Memberlist )
Newest Members:  ColeJLinskitnealsemperjrawhallshiusbozzlynobluffkatiejameshsmith101dddougal