Jump to content

[Solved] Query of CMS links in a specific CMS category


Recommended Posts

Anybody know the best query to use to grab all the links in a specific CMS category and add them to $content ? I have been digging around in other modules and have gotten close, but no cigar. My ability to write joins need some work still and I haven't the time to improve right now. Thus I reach out to those that already have it down.

Thanks

Link to comment
Share on other sites

Nevermind. ajax_blockcms.php has a good join example to use.

Db::getInstance()->ExecuteS('
   SELECT cl.`meta_title`, c.`id_cms` FROM `'._DB_PREFIX_.'cms` c
   JOIN `'._DB_PREFIX_.'cms_lang` cl ON (c.`id_cms` = cl.`id_cms`)
   WHERE c.`id_cms_category` = '.(int)($cmsCatID).'
   AND c.`active` = 1 
   AND cl.`id_lang` = '.(int)($cookie->id_lang).'
   ORDER BY c.`id_cms`');



Where $cmsCatID is the id passed into the function.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...