Forums » Customize

Automatically section name

joshdehn
FRANCE
2010-02-08 10:11:07
Permalink Post
 

Hi everyone,

I would like to add a 'div' in the '#content' of my file 'index.php' with automatically the section name.

I'm using the system variable .
It works with exhibit title , but not with section name ?

Thanks in advance
J.

Vaska A
I WROTE THIS
2010-02-08 10:12:57
Permalink Post
 

Section name is not available as a variable. I've posted a few times the way to make this happen...you will need to add ndxz_section to the query in your root index.php. But have a search for the full answer...

joshdehn
FRANCE
2010-02-08 10:52:31
Permalink Post
 

Thanks for your answer.
I'm sorry ! I've made some researches on the forum but I haven't found what you are talking about...
Maybe you can help me to find the link I'm looking for ? (It would be very helpfull).

Thanks in advance
J.

Vaska A
I WROTE THIS
2010-02-08 10:58:06
Permalink Post
 
  1. // page query
  2. $rs = $OBJ->db->fetchRecord("SELECT * 
  3.     FROM ".PX."objects, ".PX."objects_prefs, ".PX."sections 
  4.     WHERE url = '$uri'
  5.     AND status = '1' 
  6.     AND section_id = secid 
  7.     AND object = obj_ref_type");

Look for "page query" in the root index.php file and then replace the query with this one which has the sections parts added.

Now, you can access 'sec_desc' to get the name of the section. Consult the database for the other variables this makes possible as well.

joshdehn
FRANCE
2010-02-08 12:00:11
Permalink Post
 

Great, it works fine!
Thank you very much Vaska.
Have a nice day,
J.

rickykappa
ITALY
2010-02-08 12:34:39
Permalink Post
 
  1. as the example above, I've adjusted the root index.php and I've tried this in the site/mysite/index.php
  2. <div class='<%sec_desc%>'></div>

Tried as well this call in the text area and in the plugin (where I'd like to have also that section name)

  1. $a .="<p><a href='#' onclick="swap(); return false;"><b>«</b> Back to <b><%title%></b> | <b><%sec_desc%></b> thumbnails</a> | ";

(I think the code above will be a mess, though the point should be understandable)
tried as well many combinations, but can't make it work...
what am I missing?

Showing 1 - 6 of 6 posts in Forum > Customize > Automatically section name
 

You need to be logged in to post.