Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CMS techniques...Looking for help.

Status
Not open for further replies.

imstillatwork

IS-IT--Management
Joined
Sep 26, 2001
Messages
1,605
Location
US
I'm adding a article managment system to a web site of mine. I have a few questions about how to go about it for best useability.

I want to be able to upload images as I create a new article, then place them in the article where needed.

Whats the logic for this? how should it flow? It's the technique I'm after here, the code will be the easy part.

thanks!


 
If the image isn't going to go in the same place all the time you'll have to create a "tag" for it.

I've built a system where people can upload an image and give it a title. Where they want the image they just type {ImageTitle} if it's going to be in the same place at all times you just hard code it. for example if its always at the top of the article..

Code:
<div>
<cfoutput>
<img scr = "../images/#queryName.image#" align = "left">
#queryName.article#
</cfoutput>
</div>

If you don't ask the right questions, you don't get the right answers. A question asked in the right way often points to its own answer. Asking questions is the ABC of diagnosis. Only the inquiring mind solves problems.

-Quote by Edward Hodnett
 
no rules to quantity or placement. I think I've got sometihng worked out, just need to do it now.

 
I'm curious to know what your solution is.

If you don't ask the right questions, you don't get the right answers. A question asked in the right way often points to its own answer. Asking questions is the ABC of diagnosis. Only the inquiring mind solves problems.

-Quote by Edward Hodnett
 
I'm going to keep it simple.

I already have a topics / categories set up, so new images uploaded will fall into one of those.

Either on the side, or a pop up, will display thumbnails for the current topic. Clicking on a thumbnail with a bit-o-javascript will insert the "code" for that image to be displayed.

When the article is viewed, a find / replace will locate the "code" for the images and change it to img tags.

I might be leaving out something, but thats basicly it.

 
that's about how i do it. you just have to associate an image "code" with the correct location.

If you don't ask the right questions, you don't get the right answers. A question asked in the right way often points to its own answer. Asking questions is the ABC of diagnosis. Only the inquiring mind solves problems.

-Quote by Edward Hodnett
 
Cool, I just have never done this, and wasn't sure on the 'proper' way to do it. I like to try this sort of thing on my personal sites first, so it is much easier when a work related site needs it later!

 
The system I wrote is pretty simple.

I use "tags" surrounded by braces {}

I first check to see if there are at least one set of matching braces. If not there isn't any reason to do the rest.

after that you have to replace the tags.

I'm not real sure what would be quickest but there are at least 3 ways to do it.

what I do, which isn't the best way, is query for all the image titles. then I loop through them replacing any that match with the corasponding image. That's the easiest way.

Another way is to use regular expressions to get all the tags in the article. then run a query for the tags the regular expression finds. That's a more diffacult way but will be better if you have a lot of image titles to loop through.

The other way is like the regular expression way but use mid and find to parse your way through the article, then query for the found image titles.

If you don't ask the right questions, you don't get the right answers. A question asked in the right way often points to its own answer. Asking questions is the ABC of diagnosis. Only the inquiring mind solves problems.

-Quote by Edward Hodnett
 
thanks. We'll see what I do in a few days maybe.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top