Recent Topics

1 Jul 28, 2004 17:54    

I've been searching the forum for some more info on this, but I haven't been too successful.

I guess I will reveal my ignorance, but I'll ask anyway. :oops: Permalinks and Trackbacks are different, right? :oops:

Right now, in my template, the entry title links to the feedback page where the Trackback address is shown. If I put a link in the "Link to URL" when creating the post, then the entry title links to this URL, but I lose the link to the trackback address (I suppose the comments link can still be used). What I would like to do is have the entry title always link to the trackback address and have the "Link to URL" show as a seperate link at the top of the entry text, below the title. Is this possible or will I just have to create a link to this in my post?

As far as permalinks go, is this something I have to enable in a config file and add to my template?

Thanks for your help.

2 Jul 28, 2004 20:00

tim wrote:

I guess I will reveal my ignorance, but I'll ask anyway. :oops: Permalinks and Trackbacks are different, right? :oops:

oh yes, they are.

tim wrote:

Right now, in my template, the entry title links to the feedback page where the Trackback address is shown. If I put a link in the "Link to URL" when creating the post, then the entry title links to this URL, but I lose the link to the trackback address (I suppose the comments link can still be used). What I would like to do is have the entry title always link to the trackback address and have the "Link to URL" show as a seperate link at the top of the entry text, below the title. Is this possible or will I just have to create a link to this in my post?

As far as permalinks go, is this something I have to enable in a config file and add to my template?

ok, hopefully you are using a skin...

open your skin/_main.php

<?php $Item->title(); ?>

and change it to

<a href="<?php $Item->permalink() ?>" title="<?php echo T_('Permanent link to full entry') ?>"><?php $Item->title('','',false); ?></a>

now look for

<div class="bText">

and add

<?php $Item->url_link(); ?>

i haven't tested it, but normally it should work.

3 Jul 29, 2004 19:01

Thanks kiesow, it worked.

Since the function generates the link, there's probably no way to change the display text of the it is there?

4 Jul 29, 2004 19:16

please make an example of what you have and what you want...

5 Aug 02, 2004 16:11

When creating the new blog post, I type in a link to URL (ex. http:\\www.originalarticle.com\article).

In my template I use something like this:

<div class="linkedurl">
   <?php $Item->url_link(); ?>
</div>

The easiest way to show you what I want, is to use an html example.

The above code will generate (in html):

<a href="http:\\www.originalarticle.com\article">http:\\www.originalarticle.com\article</a>

What I would really like to get is:

<a href="http:\\www.originalarticle.com\article">Original Article</a>

Does that help? :)

Ohh, and the reason I would use this, is that trackbacks aren't available for every site and I need to return credit to the original source.

6 Aug 02, 2004 18:47

If you want the title to be linked, just use <?php $Item->title(); ?>, and the title will be linked automatically.

7 Aug 02, 2004 22:02

he said:

What I would like to do is have the entry title always link to the trackback address and have the "Link to URL" show as a seperate link at the top of the entry text, below the title.

8 Aug 02, 2004 23:22

*slaps head*

I think I know how to do this, but I'm too tired. I'll come up with a solution tomorrow, if no one beats me to it.

9 Aug 03, 2004 01:29

Is this what you want?

<a href="<?php $Item->permalink() ?>#trackbacks"><?php $Item->title('','',false) ?></a>

blah blah blah

<?php echo $Item->url_link() ?>

It kinda sounds like you're saying this:

<a href="<?php $Item->trackback_url() ?>"><?php $Item->title('','',false) ?></a>

but that's stupid, so I'm guessing it's the first one.

Start at http://doc.b2evolution.net/0.9.0/evocore/Item.html#methodtitle and keep reading.

10 Aug 04, 2004 22:23

Is this what you want?

<a href="<?php $Item->permalink() ?>#trackbacks"><?php $Item->title('','',false) ?></a> 

blah blah blah 

<?php echo $Item->url_link() ?> 


That doesn't look like what I'm after. When I use

<?php echo $Item->url_link() ?>

It generates the entire URL and the entire URL is shown as the link title. I want to use the above code to generate the link, but I don't want the link to show as http://www.linktourl/linkeddir/pagedir/this_is_the_page_title.html,

I want it to show as

Link

and link to http://www.linktourl/linkeddir/pagedir/this_is_the_page_title.html

Take a look at http://www.rightvoices.com/ to see what I'm after. At the top of each post they have a link to the original article.

11 Aug 04, 2004 22:28

You want this then:

<a href="<?php Item->url_link('','','htmlhead'); ?>">Link</a>

But what that site has is exactly what I said earlier. The site being linked, with the text taking on the post's title. This solution will only produce the text 'Link' every time.

12 Aug 04, 2004 22:32

actually the only possibility is something like this

open b2evocore/_class_item.php and search for

	function url_link( $before='', $after='', $format = 'htmlbody' )
	{
		if( !empty( $this->url ) )
		{
			echo $before;
			echo format_to_output( '<a href="'.$this->url.'">'.$this->url.'</a>', $format );
			echo $after;
		}
	}

you can change the $this->url between the a-tag to "Link" or so.

maybe we should make a change to the function to allow custom text for the link?

13 Aug 04, 2004 22:42

My solution will work. It displays the url link without any formatting, so can be used as an attribute in html. I've used it myself when making the skins site. The url link is the url to the download zip, and it's wrapped around the download image,

14 Aug 04, 2004 22:46

My solution will work. It displays the url link without any formatting, so can be used as an attribute in html.

Yeah, I think that will work Graham, the link will just always say the same thing instead of being dynamic. I can live with that I suppose. :) It would be nice if, like kiesow said, there was a way to allow for custom text. Perhaps we should add it to the wish list. :)

15 Aug 04, 2004 23:03

Tim,

Please iron out what you want.

Where does the text "link" come from? I thought you said that you wanted it hard-coded? :-/

16 Aug 04, 2004 23:10

Ok, I just checked out the example.

You're actually looking for something new to be added to the system (which doesn't exist yet and can't be done easily yet) - link_title.

Think about it - you'd have to store the title of the related article in a separate location.

Better yet, what if you had three different articles that you wanted to link to, all with different URLs and titles? Or if you wanted to link to another post, and have the other post automatically show that the link exists, too.

I'm working on this. I hope to have something reasonably useful (most likely a really hack-ish hack requiring manually adding a field to the db) by the end of the summer, and exactly what I want by the end of the year. Of course, those extremely rough guestimates depend on how much time I can afford to blow on a project that doesn't pay the bills.

17 Aug 05, 2004 10:56

the main thing i don't understand: why don't paste the link in the entry body as a normal link? everybody is doing it like this, if not using the url_link.

18 Aug 05, 2004 17:07

Kiesow, because you might want to style it differently than the "regular" hyperlinks, have it separate from the body of the post, etc.

I'm actually creating a new skin, and sort of running into this issue. I'd like to make the title link to the permalink, not to some outside site - this is the way that many other blogging systems and "big" blogs work. (Zeldman/ALA, Hicks, Bowman, Meyer, etc.) Then, I'm going to have a "Regarding..." link which takes you to the inspiration for the post.

19 Aug 05, 2004 18:47

I'd like to make the title link to the permalink, not to some outside site - this is the way that many other blogging systems and "big" blogs work.

Yes, that's exactly what I'm trying to do also. Isaac, I would be interested in testing the hack for this when you need some testing. Just let me know. Also, once it works fully, can it just be added as a feature to b2evo? I think a people would use it.

I modified Graham's code a little bit and added it to my skin. It's liveable for now. :D

<a href="<?php $Item->url_link('','','htmlattr'); ?>" target="_blank">Full Article</a>

Thank you all very much for your help.

20 Aug 05, 2004 22:57

target="_blank"?!

ARGHH!!!

How could you put that horrid invalid (and annoying) code onto my lovely solution?

*runs into the corner crying*

21 Aug 05, 2004 23:09

tim wrote:

I'd like to make the title link to the permalink, not to some outside site - this is the way that many other blogging systems and "big" blogs work.

Yes, that's exactly what I'm trying to do also. Isaac, I would be interested in testing the hack for this when you need some testing. Just let me know. Also, once it works fully, can it just be added as a feature to b2evo? I think a people would use it.

maybe i'm a little bit stupid, but

<a href="<?php $Item->permalink() ?>" title="<?php echo T_('Permanent link to full entry') ?>"><?php $Item->title('','',false); ?></a>

is exactly what you want. title is linking to the permalink.

and for the inspiration-link, if use something like this. i add "via link-to-foreign-blog" or "inspired by link-to-foreign-blog" in the entry and that's it.
if it should have a special design there's always the possibility to add a CSS-class to the a-link.

btw: _target is really, really bad style....

22 Aug 06, 2004 23:05

and for the inspiration-link, if use something like this. i add "via link-to-foreign-blog" or "inspired by link-to-foreign-blog" in the entry and that's it.
if it should have a special design there's always the possibility to add a CSS-class to the a-link.

The enhancement is to add the "foriegn title".

If I link to an article called "Better Image Hotlinking Protection" at [url=http://www.alistapart.com]ALA[/url], the post might be:

<a href="http://example.com/stub/2004/08/06/url_title">Anti-Hotlinking R0xx0rz!</a>
Regarding: <a href="http://www.alistapart.com/articles/hotlinking/" rel="external" title="Related Article">Better Image Hotlinking Prevention</a>
...


Form is loading...