Code Monkey home page Code Monkey logo

Comments (10)

chriskonnertz avatar chriskonnertz commented on May 21, 2024

I also wonder if it's possible to remove the "News" viewbag title from the home page

You can change it or even completely remove it. To do the latter:
Open App/Modules/News/Http/Controllers/NewsController. Find the showOverviewmethod and this (around line 54):

$this->title('no-title');

Then open <cms-folder>/contentify/HtmlBuilder.php. Find the titlemethod (around line 66). At its beginning add this:

if ($title == 'no-title') return '<title>'.Config::get('app.title').'</title>';

So it should look like this:

public function title($title = null)
{ 
    if ($title == 'no-title') return '<title>'.Config::get('app.title').'</title>';
    if ($title) {
        $title .= ' - '.Config::get('app.title');
    } else {
        $title = Config::get('app.title');
    }

    return '<title>'.$title.'</title>';
}

from contentify.

chriskonnertz avatar chriskonnertz commented on May 21, 2024

I noticed my website doesn't have a proper description in search engines

Some pages of your website should have an OpenGraph description. But yes, not the good old <meta name="description" content="whatever"> description.

I expect I have to add this to all the main view pages in app/modules from each page?

Assumed that your code works: yes. I understand that you want to have individual descriptions for particular pages. Then ofcourse you have to implement this for all of these pages.

from contentify.

 avatar commented on May 21, 2024

Thank you!

from contentify.

 avatar commented on May 21, 2024

I noticed the App/Modules/News/Http/Controllers/NewsController notitle change, changes the viewbag title from http://localhost/newsid/newstitle. I wonder if it's possible to remove the News - Website Name to Website Name instead when going to http://localhost/ (just for this index page)

from contentify.

chriskonnertz avatar chriskonnertz commented on May 21, 2024

I am 100% sure if I understand what your plan is - but try this:
Open App/Modules/News/Http/Controllers/NewsController. Find the index method (line 16). Add this code at the beginning or the end of the method (I am not sure if it matters so if it does not work in the first place try it the other way):

$this->title('no-title');

from contentify.

 avatar commented on May 21, 2024

Thank you so far! It seems to remove the viewbag title from /news but not from the 'root ' index domain, I have been looking but not sure where it loads this page from

from contentify.

chriskonnertz avatar chriskonnertz commented on May 21, 2024

Now I am confused. I guess I missunderstood something but I do not know what.

Did you add this

$this->title('no-title');

to both, the index and the showOverview method?

from contentify.

 avatar commented on May 21, 2024

Yes, that removes the 'News -' from http://www.website.com/news page, and when placing the no-notitle in showoverview it removes the title from http://www.website.com/news/newsid/titleslug. What I would like to achieve is remove the 'News-' from the http://www.website.com/ page. All the changes that i've done to the NewsController so far haven't been able to achieve this yet. Hope you understand me now cause it's hard to explain :)

from contentify.

chriskonnertz avatar chriskonnertz commented on May 21, 2024

No offense but I am quite sure that you did not follow my instructions in the right way. 😛

This is how your app/Modules/News/Http/NewsController.php should look like (or at least very similar):
http://pastebin.com/XPmn2i2d

Line 54 is the important line. It's inside the showOverview() method. This method is called when you navigate to your website without navigating to a particular page. Example: http://demo.contentify.org/
So there is no way that this behaviour occurs:

I noticed the App/Modules/News/Http/Controllers/NewsController notitle change, changes the viewbag title from http://localhost/newsid/newstitle

If this happens then I assume you made the wrong change to the code. So compare your NewsController.php to the one I've posted above.

from contentify.

 avatar commented on May 21, 2024

I did indeed make a mistake I was adding it in the show() method instead of the showOverview(). It is working properly now, Thank you!

from contentify.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.