By tatar111 on
I got on example http://aporia.com.pl/filozofia-wstep On bottom of article, its something like "Link that"
Podlinkuj wpis:
<br />Kod html do wstawienia na stronę:
<br /><textarea style="width: 400px; height: 3em"><a href="http://aporia.com.pl<?php echo $_SERVER['REQUEST_URI']; ?>">Something</a></textarea>
<br />Kod BBCode do wstanienia na forum:
<br /><textarea style="width: 400px; height: 3em">[url=http://aporia.com.pl<?php echo $_SERVER['REQUEST_URI']; ?>]Something[/url]</textarea>Its code for BBCode and html on site. Its great generate me suitable url. But how to make this will code will also print not anachor text "Something" but a title of article?
Comments
Maybe that will be more
Maybe that will be more simple. How to make to print (by using php or something else) somewhere in content a title of node that code is in?
Think. Filozofia i Religia. Or Filozofia i Religia.
How about some context
Where are you tring to print this information from, a template file (*.tpl.php), template.php, a node body, somewhere else?
I want to print it in
I want to print it from title of article. How?
Think. Filozofia i Religia. Or Filozofia i Religia.
This will work for page views but not teasers
The content of a node is unaware of what node it sits in. When the node is displayed by it's self the path is of the form "node/{nid}" and one can get the information you want. Note though, the teaser view will not have this information available.
So the first part is to get the node object
Then in the code you can build links like this
The example links the node back to it's self, you probably want a different path.
No, its not that I need but
No, its not that I need but thx. Maybe somehow to print a all h2 on site in place I want? How to do that? Or maybe get some title from database, but how?
Think. Filozofia i Religia. Or Filozofia i Religia.
To many or conditions :)
Can you clearly state what you are trying to do, what it is you want to achieve. I am unclear if you are trying to change the way the page looks or add a link within content (the later is not about h2 tags).
Tell me only how to print
Tell me only how to print somewhere in article a title of it by php. I dont want to write it manual. Example:
How to print by using php. Because when I edit a title I want it automatical to change in content. How to do that?
Think. Filozofia i Religia. Or Filozofia i Religia.
Comment above
That is what the comment http://drupal.org/node/183694#comment-281338 does but it only applies to full page views and not other cases (list and teaser views).