Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8206653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T08:44:57+00:00 2026-06-07T08:44:57+00:00

My CodeIgniter website’s controller is set up like this: $this->load->view(‘head’, $data); // Contains <head>

  • 0

My CodeIgniter website’s controller is set up like this:

$this->load->view('head', $data); // Contains <head> stuff
$this->load->view('header', $data); // Nav and sidebars
$this->load->view($this->uri->segment(1), $data); // Main page content
$this->load->view('footer', $data); // Footer

My question is about where to store <title> tag’s content. Ideally it would be with the page content (the 3rd loaded view) but then how do you get that into the <title> tag which has been loaded in the first view?

I’ve read that it’s bad to have JavaScript set the title as it won’t be compatible with search engine bots.

I’ve also read a suggestion which said to have a large view file with all the pag

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T08:44:58+00:00Added an answer on June 7, 2026 at 8:44 am

    I have thought of a way to solve my issue, and I got the idea from http://joshhighland.com/blog/2008/11/09/how-i-do-layouts-and-views-in-codeigniter/. If you look on that page you can see a line like this near the bottom of the first code extract:

    $layout_data['content_body'] = $this->load->view('home/homePage', $body_data, true);
    

    This loads the view as a string into that variable. I will then run a function on that string to extract what I want the title to be (I will store it in an HTML comment) and put it into $layout_data['pageTitle']. Then, by following the rest of the layout method on the link, I will be able to solve my issue.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use Codeigniter platform to make a website I used this .load script to
i have a codeigniter website structured like so: website.org/files/stuff/1/example.pdf website.org/www/index.php So all files (many
I am using codeigniter for my website.i had a situation to load a view
I am planning a new website with codeigniter using wordpress. this site will contain
I read this the best way to make codeigniter website multi-language. calling from lang
This is my first time building a website and using CodeIgniter for a school
I am using the gapi class in a CodeIgniter website. I am using this
I have built a multilingual website with CodeIgniter using this library: http://codeigniter.com/wiki/URI_Language_Identifier/ I use
I am using codeigniter and when I set up the website I added necessary
I have a domain set up: www.domain.com, that runs a codeigniter website. I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.