Internal links in the MCE editor

145 views
Skip to first unread message

K Levenstein

unread,
Dec 20, 2011, 7:52:06 AM12/20/11
to mezzani...@googlegroups.com
I just noticed the MCE editor widget does handle filebrowser's links
fine, including references to uploads. However, apparently this is not
the case for a basic component of the content hierarchy.... the very
pages it is comprised of. Am I missing something or users are expected
to link pages manually? Since we can edit slugs as we please, this is
only an annoyance when editing. Having a widget that lets us pick a
target page would be ideal.

Josh Cartmell

unread,
Dec 20, 2011, 12:11:17 PM12/20/11
to mezzani...@googlegroups.com
The TinyMCE content stored is all stored statically in the database so I'm not sure how a widget that let you pick a page would work.  What exactly did you have in mind?

Regards,
Josh

K Levenstein

unread,
Dec 20, 2011, 12:48:38 PM12/20/11
to mezzani...@googlegroups.com
Like most autocomplete hacks... they usually perform an ajax request
and take JSON to build a dictionary of matches.
I bet there must be something done already for TinyMCE, perhaps in
some other CMS project.

All we need is a subset (or full set, what is the average page count
for most Mezzanine users?) of the pages.
I'm not sure but I think jQuery already gives autocomplete
functionality that can be reused for this purpose.
Perhaps someone with better knowledge of it and other toolkits for the
web can help, that's not my realm to be honest, though I could feel
pressed to write the feature in the foreseeable future.

Stephen McDonald

unread,
Dec 20, 2011, 2:44:02 PM12/20/11
to mezzani...@googlegroups.com
I've implemented this in other CMSes in the past and it'd be a great addition.

So a view in mezzanine.pages that dumps JSON for titles and urls of all pages, and a select list that's populated by it (no need for autocomplete) in the static TinyMCE template for adding links.

Taking it one step further, another view could be added in mezzanine.pages that accepts a page ID rather than a slug and then page IDs could be used in the JSON and TinyMCE template for creating links - that way links won't go stale should their slugs be changed.

Would love to see you implement this - very little internal knowledge of Mezzanine required.
--
Stephen McDonald
http://jupo.org

Gary Reynolds

unread,
Dec 20, 2011, 6:06:31 PM12/20/11
to mezzani...@googlegroups.com
It should be as simple as ensuring the TinyMCE editor instance is loaded with external_link_list_url pointing to a view which returns a valid format - see http://www.tinymce.com/wiki.php/Configuration:external_link_list_url.

I think having a "bounce" url that accepts the page id and performs a temporary redirect would work, however not sure how much the SEO experts would like it?

K Levenstein

unread,
Dec 23, 2011, 7:38:33 AM12/23/11
to mezzani...@googlegroups.com
Nice!

I would say textual links using the slugs are much better, from a
technical perspective they are more expensive to have, but numeric
links are awful.
It's not as much about SEO as knowing what was visited by means other
than the page title. This helps a bunch with logging, so we can trace
problems easily at a glance.

How should we proceed then? Does TinyMCE make use of that dictionary
out of the box if we provide it?
Do we need to alter the initial loading, and if so, Steve, where is
the file to apply the changes? (the one with the TinyMCE config,
likely grappelli).

This will be a Mezzanine specific change so I think we should overload
or override whichever template was grappelli using. And perhaps add a
block to do a fine grained override if there's none.

Stephen McDonald

unread,
Dec 24, 2011, 3:58:44 PM12/24/11
to mezzani...@googlegroups.com
Thanks for the pointer Gary, that's ace.

Kevin the TinyMCE setup is in: mezzanine/core/media/js/tinymce_setup.js

Stephen McDonald

unread,
Sep 30, 2012, 8:12:22 AM9/30/12
to Alexander Kominek, mezzani...@googlegroups.com
Nothing's happened here as far as I know. Ideally if you were to work on it you could contribute it back to the project. Let us know how you go.

On Sun, Sep 30, 2012 at 7:24 AM, Alexander Kominek <alexande...@gmail.com> wrote:
Has this been implemented as part of Mezzanine, or should I create it for my own site?

Stephen McDonald

unread,
Dec 14, 2013, 2:35:51 AM12/14/13
to Alexander Kominek, mezzani...@googlegroups.com
Really old thread, but I've just added what was discussed here.


So now in TinyMCE when editing links we get a drop-down with names/urls for all Displayable subclass instances throughout the site (using the same logic that generates sitemap.xml)

Eduardo Rivas

unread,
Dec 17, 2013, 9:30:41 AM12/17/13
to mezzani...@googlegroups.com, kvnleve...@gmail.com
Wow, thank you very much Steve! This will be really handy.

Alexander Kominek

unread,
Dec 17, 2013, 12:08:45 PM12/17/13
to mezzani...@googlegroups.com, kvnleve...@gmail.com
Awesome!


On Tue, Dec 17, 2013 at 7:30 AM, Eduardo Rivas <jeriva...@gmail.com> wrote:
Wow, thank you very much Steve! This will be really handy.

--
You received this message because you are subscribed to a topic in the Google Groups "Mezzanine Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mezzanine-users/PIo1lHUZ1aA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mezzanine-use...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages