i need a setting "Display anchor text on janode view?"

it need a one new table (anchor) and change some functions

Comments

AjK’s picture

Sorry, I don't understand the feature request. Can you be a bit more specific please?

best regards
--AjK

kors4r’s picture

sorry, I don't speek english too good

thank you for your update :)

so - now, when you submit a "janode", you must fill:
- title,
- description,
- url

by view this node, system show title, description and url: <a href="SUBMITTED URL">SUBMITTED URL AS ANCHOR TEXT</a>

I need a one more textarea in submit form: Anchor, and another url in view of node (with anchor as anchor, not url as anchor)

do you understand me?

AjK’s picture

Sorry, no, I don't understand. May be you could create an example and supply a url to it so I can look at what you would like to be seeing?

best regards
--AjK

AjK’s picture

Assigned: Unassigned » AjK

assigning issue to "me"

kors4r’s picture

ok,

NOW janode works so:
1. user submit a node type 'janode', he must fill: "Title" (like all nodes), "Description" (like all nodes), "URL", all this information drupal save in database
2. When user want to see this node, drupal show:
- title
- description
- url (drupal build link html code like: <a href="URL SUBBMITED BY USER">URL SUBMITTED BY USER=ANCHOR TEXT</a>

We have 3 params of node: title, description and url

I need a one more param: Anchor text

It should works so:
1. When user submit janode, must give:
- title (like now it is)
- descriptoin (like now)
- url (like now)
- anchor text for url (THIS SHOULD BE ADDED)

2. When user view a janode, drupal show:
- title,
- description
- url (BUT: drupal should build a link code like this: <a href="URL SUBMITTED BY USER">ANCHOR TEXT</a>

best regards

kors4r’s picture

i have idea!

can drupal build link code like this?
<a href="URL SUBMITTED BY USER">TITLE SUBMITED BY USER</a>

I don't know how to modify a module code, can you do this?

best regards

AjK’s picture

OK, I think I understand this now. What you want is a field that "describes" the link that is placed between the and the right?

That's doable and I'll think on it. It would require a db mod and not yet ready to do that. Another "feature request" may also need a db update so if and when I do that I will add in this functionality at that time.

As for the TITLE SUBMITED BY USER I don't think that's a good idea as the node already publishes the USER anyhow.

best regards
--AjK

AjK’s picture

Status: Active » Closed (won't fix)

Actually, I've given this some more thought and I've decided not to do it.

My reasons are simple, there already exists a title and a massive body area to describe the link in great detail. So, adding in a method that allows <a></a> text to be alter seems a bit pointless. Also, I like the links starting with their protocol (http://) so it's very obviously a link to end users.

So I'm going to change this to "won't fix".

I do however think that implementing a "links exchange" enforcement protocol (on your other issue) is a good idea and will be doing that.

regards
--AjK

kors4r’s picture

oki, it's your project

but I will try :)

in this time I don't have computer at home :(, so I can't do anything now

but soon I will make so change:
in module file i found a code

function theme_janode_http_link($node) {

  $link_class  = _janode_local_settings('html_link_class');
  $link_class_array = (strlen($link_class)) ? 
    array('class' => $link_class) : array();

  $link_prefix = _janode_local_settings('html_link_wrapperA');
  $link_prefix_text = (strlen($link_prefix)) ? (check_markup($link_prefix,FILTER_FORMAT_DEFAULT, FALSE)) : ('');

  $link_suffix = _janode_local_settings('html_link_wrapperB');
  $link_suffix_text = (strlen($link_suffix)) ? (check_markup($link_suffix,FILTER_FORMAT_DEFAULT, FALSE)) : ('');

  $link_text = l($node->http_link, $node->http_link, $link_class_array, NULL, NULL, FALSE, FALSE);
  return $link_prefix.$link_text.$link_suffix;
}

see this:

 $link_text = l($node->http_link, $node->http_link, $link_class_array, NULL, NULL, FALSE, FALSE);
  return $link_prefix.$link_text.$link_suffix;
}

will it be working with something like this?

 $link_text = l($node->http_link, $node->title, $link_class_array, NULL, NULL, FALSE, FALSE);
  return $link_prefix.$link_text.$link_suffix;
}

I changed a 'l()' function - it wait for some data, maybe janode.module should give to l() not twice $node->http_link, but one $node->http_link and one title of this node (in this case, l() should build link code with NODE TITLE as LINK DESCRIPTION = Anchor text)

best regards

AjK’s picture

Status: Closed (won't fix) » Active

By all means have a go at hacking it up and adding the feature. If you do, please supply a patch for review so that it can be considered for inclusion/commit. After all, Drupal is about sharing and helping others when it comes to code.

I've change the status of this from "won't fix" to "active" on the assumption that you may well supply a patch.

best regards
--AjK

Coyote’s picture

I think that there _definitely_ needs to be a way to have the URL link appear as something other than the url itself.

For instance, what if the URL referenced is something dreadfully long and ugly? Or that shoots of the end of the screen (for instance, a link to an article on a news or blogging site)?

There should be, ideally, an option for the clickable link to use, as a label:

-- a plain default text used by all links (for instance "Click to visit this link" or "[link]"
-- a user-definable label (probably should be optional)
-- the text of the url itself
-- possibly something like "click here to visit %urlname"

Very often, the actual URL itself will make a terribly ugly or unmanageable label. This could be something that makes someone leery of using this otherwise decent module.

Coyote

AjK’s picture

OK, the reasoning is sound (aka ultra long dumb ass URLs can break your theme).

I oersonally would just prefer to "trim" to length that anchor section but I'll bow to pressure and put this in.

I'm currently doing some paid work at the mo so it'll take a few days (unless someone supplies a patch ;)

Anyhow, it'll involve a db alteration to add in the extra info required. Since I'm making db alterations there's another feature request regarding link exchanging that I'm going to do so I'll try and do both at the same time.

best regards
--AjK

kors4r’s picture

quote:
"
1. -- a plain default text used by all links (for instance "Click to visit this link" or "[link]"
2. -- a user-definable label (probably should be optional)
3. -- the text of the url itself
4. -- possibly something like "click here to visit %urlname"

/quote

google and other search engines will see "description" (anchor text) of link

if you will submitted jandoe about your site ("www.example.com") - you want to show google, that "Click here to visit www.example.com" is keyword for your site, or want to show google, that keyword is "Example"?

if you think about SEO, you want to have a "Example" (or other keyword) in descriptions of your links (on other sites), write?

so, in my opinion, the best is:
"2. -- a user-definable label (probably should be optional)"

best regards

kors4r’s picture

it works 8)

if anybody want to have "Title" of nody in description of link, please change function "theme_janode_http_link" (line: 331 in janode.module file):

in line 343
from:

  $link_text = l($node->http_link, $node->http_link, $link_class_array, NULL, NULL, FALSE, FALSE);

to:

  $link_text = l($node->title, $node->http_link, $link_class_array, NULL, NULL, FALSE, FALSE);

best regards

AjK’s picture

Version: 4.7.x-1.x-dev » master
Status: Active » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)