![]() |
Dynamic Meta Description - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Dynamic Meta Description (/showthread.php?tid=69223) |
Dynamic Meta Description - shamzblueworld - 10-21-2017 Hello everyone, I hope this is the right section to ask this question. I'm building a Quiz Portal on CodeIgniter. I've added meta description tag in the header view, but now that I've checked on Google, the same meta description is showing at all the pages indexed in Google. Can anyone please guide on how to show different meta descriptions, according to views or modules? Is there a library for that, or how to do it manually? Would appreciate any help. Thanks RE: Dynamic Meta Description - InsiteFX - 10-21-2017 Pass it to your different page views using the views $data array. This way you can have it in the database and load it with the page. RE: Dynamic Meta Description - Jeewakapk - 12-10-2020 (10-21-2017, 09:26 AM)InsiteFX Wrote: Pass it to your different page views using the views $data array. Hi I used layout view in CI4 how to do meta description, page title and so on? can you kindly show me the code? RE: Dynamic Meta Description - InsiteFX - 12-10-2020 I create a data.php view in the vVews folder this is just a blank php file nothing in it. It allows to have data for all the other views. To use: PHP Code: $data = [ RE: Dynamic Meta Description - Jeewakapk - 12-10-2020 (12-10-2020, 07:50 AM)InsiteFX Wrote: I create a data.php view in the vVews folder this is just a blank php file nothing in it. Thank you so much InsiteFX. I am beginner to CI4 and PHP. is it possible to share folder you have worked. So I can understand better. RE: Dynamic Meta Description - InsiteFX - 12-10-2020 There's really nothing to it, just create a _viewdata.php file in your Views folder with nothing in it. PHP Code: // the $data keys are the $title, $heading and $meta in the views. That's all there is to it, you can also use the below in your layout's PHP Code: // you can also include other views in the layout like below It's very easy to do. RE: Dynamic Meta Description - Jeewakapk - 12-12-2020 (12-10-2020, 12:05 PM)InsiteFX Wrote: There's really nothing to it, just create a _viewdata.php file in your Views folder with nothing in it. RE: Dynamic Meta Description - luckmoshy - 01-12-2022 (10-21-2017, 07:32 AM)shamzblueworld Wrote: Hello everyone, How did you solve that I am facing this issue |