views:

28

answers:

1

I'm building a CMS and I want to be able to insert "stuff" in arbitrary locations in a document (CMS page).

The "stuff" objects will have generic foreign keys and can be a table generated from a db entry, or it can be an uploaded image or something else.

I've seen that Nathan Borror's django-basic-apps contains a basic-inlines app which looks like it could be a good solution (based on the screencast from django-mingus), but I want to make sure that there aren't alternatives that I've missed.

Suggestions to alternative solutions are greatly appreciated.

+1  A: 

My solution to this problem dates back to the last century :-). I give my customers a simple reference mechanism to any object. Specifically:

    "Lorem ipsum dolor sit amet, [[article.129 | consectetur adipisicing elit]],
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."

Where article.129 can be any class.id pair. The | is optional as is the text after it. If it's there, that's the link text, if not I do object.title_for_link() and use that. This is easy stuff to match with regexp and solves all sorts of intra-site referencing problems. I normally give them a special page that lists all class.id pairs along with what it gets them. They bring it up in a separate tab and use it for reference while editing.

BTW, the reason for using the .id is because titles change, but ids don't.

I am working on a new site where we are using reStructured Text as the primary input format. Although it works OK to keep my author (who has a tendency for flamboyant typography) from getting out of control, I still had to extend it to make this type of reference available. There are several similar reference mechanisms for images, etc., but the idea is to keep the author focused on content production and as far away as possible from worrying about proper HTML markup.

Peter Rowell
Thanks. This is similar to the approach from django-basic-apps, I believe. I guess this is the way to go.
vorpyg