Jump to content

Site Doc Naming Order By Id


Guest
 Share

Recommended Posts

Hi,

With the site docs, I wanted to change the order of the links via the TPL files rather than going through the database and renumbering the order. Anyway, I can manually change the doc-id to what I want like this

From

<a href="index.php?act=viewDoc&amp;docId={DATA.doc_id}" class="txtSiteDocs">{DATA.doc_name}</a>

To

<a href="index.php?act=viewDoc&amp;docId=2" class="txtSiteDocs">{DATA.doc_name}</a>

(which would show my second doc)

BUT the problem is the Doc Name. No matter what order I put them in, the Doc Names still go in the order of what is in the sitedocs.inc.php file

So, basically, without having to change {DATA.doc_name} to the actual text or adding a {LANG_?} parameter, how can I get the 'Doc Name' to reflect the 'Doc Id' in the sitedocs.tpl file?

Link to comment
Share on other sites

OK, firstly, I know I can manually change the site doc names by replacing {DATA.doc_name} with the actual name of the page BUT I would like the option of having the name automatically reflecting the id. I don't want to fiddle around with my database for something as small as this when I could have the option of just changing the TPL file. It's just a matter of control.

Also, if I can find the alternative to {DATA.doc_name}, I will be able to have more control over my categories and subcategories order, too.

I have already checked out the FAQ in regards to the reordering of the site docs but the options are limited. There's ordering ascending or descending by ID or ordering ascending or descending by name.

The other problem with this line, if I were to put it into the site docs

<a href="index.php?act=viewDoc&amp;docId=1" class="txtSiteDocs">{DATA.doc_name}</a>

is that even though I can reorder the the site docs themselves, the Doc names still reorder in the way outlined in the sitedocs.inc.php file. EG the pages with the IDs 1,2 and 3 could be ordered to be 3,1 and 2 BUT the doc names would still have the 1, 2 and 3 order

I've tried changing {DATA.doc_name} to

{DATA.doc_name=doc_id} but that gave a blank result

{DATA.doc_id} but that just printed the doc ID number instead of the name

So, because I am a technical dumkopf I experiment with different variation but I mostly get error pages or blank spaces where the name should be.

I wanna make sure that I can fix this through the TPL file and not through the include file.

So, if anyone finds the solution (before me), please let me know.

Thanks

PS: And please don't suggest that I get a mod instead. I would rather have a solution and learn something from the experience.

Link to comment
Share on other sites

Just hardcode the document name aswell then, so the template does not autogenerate the list.

I suppose you are right. I've scoured a number of files trying to work something out but I suppose the simplest way is to just type the text normally without screwing with coding or over-technical crap. I suppose I was making abig fuss over something so small.

Thanks for the wake-up slap to the face, Robsta. I needed it.

Cheers

Link to comment
Share on other sites

Just hardcode the document name aswell then, so the template does not autogenerate the list.

I suppose you are right. I've scoured a number of files trying to work something out but I suppose the simplest way is to just type the text normally without screwing with coding or over-technical crap. I suppose I was making abig fuss over something so small.

Thanks for the wake-up slap to the face, Robsta. I needed it.

Cheers

:rolly: a pleasure :huh: tehehe. This is the only way to do it purely within the template file.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...