Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Creating links to an intermediary page is going to wind up ruining search engine optimisation. Instead of linking to /freelinking/whatever, we can easily construct a path to the proper page path.
Comment | File | Size | Author |
---|---|---|---|
#1 | proper_links_0.patch | 1.09 KB | ceejayoz |
proper_links.patch | 1.09 KB | ceejayoz | |
Comments
Comment #1
ceejayoz CreditAttribution: ceejayoz commentedSorry, I seem to have left the '.old' in the old filename. Try this version instead:
Comment #2
laghalt CreditAttribution: laghalt commentedThis is right - besides that the patch only work in some cases (havent figured out wich ones) - and that it makes the "add node" function without the name of the node (minor problem).
Comment #3
awgrover CreditAttribution: awgrover commentedI was tempted by this idea too. Here's the cases I can think of:
Traditional Wiki's handle this by replacing the "freelink" at display time (regexp replace). Renaming a page is dealt with by regexp-replace'ing the freelink in all the wiki-pages.
I considered generating
<a class="freelink" ...>
, which is findable/replaceable. However, when we need to fix the href, how do we find all the text (body, fields, etc.) of each node type.Perhaps we could put in php-code to calculate the href, and cache the calculation. Flush the cache anywhere that creates/deletes a page, or changes its title. Can we put a hook in for all cases of title change? On edit, we replace the php-block with the freelink ([[...]]/CamelCase). Are filters "bi-directional" (transform on display & submit)?
None of this seemed like a good idea.
Comment #4
mlncn CreditAttribution: mlncn commentedSubscribing. I think the retease module does whatever is needed to regenerate input filters output.
This might not be at all impractical to do every time a new node title matches a freelinking link.
ben, Agaric Design Collective
Comment #5
rand0mmm CreditAttribution: rand0mmm commentedUh, something like this is BITING my little install.
I am new to DRUPAL, but using alot of perl wiki stuff, php galleries, css, etc.
Setup seems good. Glad to find wiki creole inside PEAR wiki module.
Installed Freelinking, and wikitools as well. Running on all latest stuff. Maybe there are better older versions???
Well now I see links like [[Contact]] behaving badly...
As an admin I see: http://mysite.com/?q=node/7 (which opens and works fine)
but as an anonymous user, I see: http://mysite.com/?=freelinking/Contact (which breaks: "You are not authorized to view this page")
but if I click on the Contact primary link... http://mysite.com/?q=node/7 (which opens and works fine)
Have tried turning toggling the wikitools ability to hijack freelinks. No difference. Both work equally badly.
have tried adjusted user permissions for content; also freelinks, none there but sidebar links option.
Any ideas or suggestions welcome.
DRUPAL rearrranged: URLPAD
Comment #6
dugh CreditAttribution: dugh commentedsubscribe
Comment #7
SamRose CreditAttribution: SamRose commentedI tried this patch. It seems to be working but retease did not seem to make a difference for what is discussed in http://drupal.org/node/156523#comment-577014 above (#2)
Comment #8
Owen Barton CreditAttribution: Owen Barton commentedSubscribe
Comment #9
Gerard McGarry CreditAttribution: Gerard McGarry commentedI've installed the patch, and while it seems to fix freelinks that exist, it does break the link where a page creation has to happen.
Looking at the patch code (disclaimer: I'm no PHP expert), but shouldn't it be possible to distinguish if the string has '/node/add/wiki' in it, and if that's the case, serve up the freelinking link, but otherwise serve up the direct link to the page a la modified patch code.
Let me try and mock something up here...around line 280 of the freelinking.module (in my installation), there's a line which reads
What if this was replaced with an IF statement that serves the original line if the page doesn't exist, but serves the real link if the page does exist? I'm thinking about something like this (apologies in advance for substandard PHP code)
As I say, I have next to no PHP experience, and I suspect the usage of substr() is dodgy, but does this raise a possibility of fixing the freelinking filter so that valid links are done properly?
Comment #10
aflores3 CreditAttribution: aflores3 commentedsubscribe
Comment #11
Flying Drupalist CreditAttribution: Flying Drupalist commentedAnything for 6.x?
Comment #12
tignux CreditAttribution: tignux commentedsubscribe
Comment #13
arhak CreditAttribution: arhak commentedsubscribing
BTW: would be nice this module render without taking into account filter's cache while keeping track of the links rendered, then when some new node is created or an existing node deleted this module would hook into nodeapi to know if it affects any rendered link, so it would delete the cached version of the rendered node.
Comment #14
Roulion CreditAttribution: Roulion commentedsubscribing for D6
if this could work, can we add a special css class for existing content (and thus be able to see which node have to be created)
Comment #15
arhak CreditAttribution: arhak commented+1 for different css for each kind of link (existing ones, pending, even external vs internal, and so on)
[edit] BTW, any css improvement would be a "feature request" and should go to a different issue, please don't mess up the issue queue mixing subjects
Comment #16
Gerard McGarry CreditAttribution: Gerard McGarry commentedOK, three months later, and I think I may have a solution for this issue. Now, my solution is for Drupal 6 - I'm not sure if this code can be backported to D5, but I have this running on version 6.x.1.7 of the Freelinking module and it gives direct links to existing nodes while using a /freelinking path to link to non-existant nodes.
In response to some of the comments above, I've added a css class called noexist for anyone who wants to use CSS to theme missing nodes. I've also added the rel=nofollow attribute so that non-existant pages aren't followed by search engines.
I have no idea how to submit a patch, so here's how I edited the file - perhaps someone can help put a patch submission together for this?
At line 479 of freelinking.module, the following line can be found:
I replaced this with
This works for me, although sometimes it takes you to save an edit to the current page to force the links to update. Is this a possible caching issue?
Comment #17
arhak CreditAttribution: arhak commentedwhere is considered the cached version?
if the nodes are created or deleted the existence won't be updated since it will be cached
also would be needed to demand the erasure of the cached version whenever a creation/deletion is detected, therefore it would be needed to track that hooking on nodeapi
Comment #18
Roulion CreditAttribution: Roulion commentedit works for me also. and with we can add a specific css style to non-exsting node linkswhich is cool
thanks
Comment #19
eafarris CreditAttribution: eafarris commentedA freelinking-6.x-2.x branch exists to handle this feature. The latest version of Gerard's code is used.
Comment #21
Roulion CreditAttribution: Roulion commentedChanging, line 485
and, line 493
with
in freelinking .1.x seems to work properly, in order to have specific style for existing freelinks and non-existing freelinks
Is there a way to integrate it
Comment #22
Roulion CreditAttribution: Roulion commentedComment #23
Grayside CreditAttribution: Grayside commentedFreelinking 1.x is feature-frozen. If you want to create a patch I will link to it from the project page.
The 3.x line is a complete break with the features/ path.