Dynamic Meta Description |
10-21-2017, 07:32 AM
(This post was last modified: 10-21-2017, 07:57 AM by ciadmin. Edit Reason: seo spam redacted )
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
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. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
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 = [ What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(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.
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. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(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. (10-21-2017, 07:32 AM)shamzblueworld Wrote: Hello everyone, How did you solve that I am facing this issue Do Codeigniter Before Do You!
yekrinaDigitals
|
Welcome Guest, Not a member yet? Register Sign In |