Originally posted by Zest
View Post
Announcement
Collapse
No announcement yet.
List from just one section level...
Collapse
X
-
-
Originally posted by Zest View PostBrill, this work great! Just typed in wrong. Just one last thing to finish this off?
How can I now add a menu header e.g.
<h2><actinic:variable name="SectionName" /></h2>
But this stay static for the level 1 header? It would also be good to identify this so you have some code that could also fetch the brand logo?
Hope you can help
Code:if (!function_exists('GetLevel1Section')) { function GetLevel1Section($connect,$sectref) { $query = "SELECT [Section Text], [nParentSectionID], [nSectionID] FROM [Catalog Section] WHERE [nSectionID] LIKE '".$sectref."'"; $result = odbc_exec($connect, $query); $returnstring=""; while(odbc_fetch_row($result)){ $SectionText = odbc_result($result, 1); $nParentSectionID = odbc_result($result, 2); $nSectionID = odbc_result($result, 3); if ($nParentSectionID!=0) { $returnstring=GetLevel1Section($connect,$nParentSectionID); } else { $returnstring=$nSectionID."|".$SectionText; } } odbc_free_result($result); //odbc_close($connect); return $returnstring; } } if (!function_exists('GetLevel1SectionWrapper')) { function GetLevel1SectionWrapper($sectid,myresult) { $connect = odbc_pconnect("ActinicCatalog9","","", SQL_CUR_USE_ODBC); $resultage = GetLevel1Section($connect,$sectid); $resultarray = explode("|", $resultage); odbc_close_all(); return $resultarray[myresult]; } }
To get top level section ID
Code:<actinic:block php="true" > MakeNav(GetLevel1SectionWrapper('<actinic:variable name="SectionID" selectable="false" />',0),2,0,<actinic:variable name="SectionID" selectable="false" />); </actinic:block>
Code:<actinic:block php="true" > echo GetLevel1SectionWrapper('<actinic:variable name="SectionID" selectable="false" />',1); </actinic:block>
Comment
-
Originally posted by Zest View PostGreat, Thanks but above code returns error:
Parse error, expecting `''' or `T VARIABLE' in main on line 39
if (!function_exists('GetLevel1SectionWrapper')) {
function GetLevel1SectionWrapper($sectid,myresult) {
Code:$returnstring=$nSectionID."|".$SectionText;
Code:$returnstring=$nSectionID + "|" + $SectionText;
Comment
Comment