1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

is there a simpler way to get submission info for meta data?

Discussion in 'Installation and General Troubleshooting' started by blinger187, Sep 28, 2013.

  1. blinger187

    blinger187 New Member

    my current code looks like this, just wondering if there are simpler / easier / better ways of doing the similar code. i am very new to php, still learning but it's been fun thus far.


    Code:
    
    	public function header_meta($h)
    	{
    		if ($h->pageType != 'post') { return false; }
    		$meta_artist = sanitize($h->post->artist);
    		$meta_artist = truncate($meta_artist, 200);
    		$meta_songtitle = sanitize($h->post->title);
    		$meta_songtitle = truncate($meta_songtitle, 200);
     		$meta_content = sanitize($h->post->content, 'all');
    		$meta_content = truncate($meta_content, 150);
    		echo '<meta name="description" content="Listen to and Download ' . $meta_songtitle . ' by ' . $meta_artist . '. ' . $meta_content . '"  />' . "\n";
    		return true;
    	}
    
    
    i'd also like to do something similar with the title tags (inserting dynamic content) where would it be best to tap into the title tag at?

    - - - Updated - - -

    also, i'm not sure if we should still be using the old documentation or not .. but it appears this page may need updated.

    i was unable to find the function in submit - it was actually located in bookmarking.php


    http://docs.hotarucms.org/index.php/Changing_the_Meta_Tags
     

Share This Page