Login     Sign up
How to change the homepage..add new boxes/content
John D (@johnd)
Join date: Oct 29th 2010
Community posts: 132
View Profile
Send Message

Hey,

I want to add some new things on the homepage only.

Can anyone tell me where to place my code please?
I have been trying to edit the home.tpl.php but I dont know exactly where to place it.

I want to put my content under the "Quick share" box.
Can I place 2 HTML tables under this?

Thanks very much

173 months ago
Jcow Master (@falcone)
Join date: Sep 2nd 2010
Community posts: 917
View Profile
Send Message

what do you mean with homepage ?

there is no file called home.tpl.php

173 months ago
AL (@switch48)
Join date: Sep 1st 2010
Community posts: 450
View Profile
Send Message

I think he means dashboard

173 months ago
John D (@johnd)
Join date: Oct 29th 2010
Community posts: 132
View Profile
Send Message

Yep the dashboard/homepage, what would normally be index.

home.tpl.php is in the themes/blue folder that is included in the download.

173 months ago
Jcow Master (@falcone)
Join date: Sep 2nd 2010
Community posts: 917
View Profile
Send Message

the quick share form you find in dashboard.module.php

[code]
$lblocks[] = array('title' => t('Quick share'),'content'=>stream_form($client['id']).'<div style="height:7px"></div>');
$lblocks[] = $this->newsfeed(10);
[/code]

173 months ago
John D (@johnd)
Join date: Oct 29th 2010
Community posts: 132
View Profile
Send Message

Thanks for the quick reply :)

Unfortunately I dont know PHP :(
Is there any easy way to make a "block" like the newsfeed for example, with the title and replace the avatar/status etc. with my own HTML?
Hoping there is some code I can copy and just place my HTML in place of the PHP for my own blocks.

Thanks again :)

173 months ago
AL (@switch48)
Join date: Sep 1st 2010
Community posts: 450
View Profile
Send Message

Like this

[img]http://indexjunkie.com/images/91453288148857412920.png[/img]

173 months ago
John D (@johnd)
Join date: Oct 29th 2010
Community posts: 132
View Profile
Send Message

Hey,

Yeah thats exactly what I mean :)

If I knew PHP Im sure I could easily do it but I dont know how to put in PHP, I had a look at the code and tried a few things but couldnt get it working.

173 months ago
AL (@switch48)
Join date: Sep 1st 2010
Community posts: 450
View Profile
Send Message

Ok I dont know if this is the right way to do it or not I'm a newb at this too hehe ,but it works for me ,give it a go...

Put this

[code]$lblocks[] = array('title' => t('YOUR TITLE HERE'),'content'=>'<div>...Put Stuff Here...</div>');[/code]

above or below this

[code]$lblocks[] = array('title' => t('Quick share'),'content'=>stream_form($client['id']).'<div style="height:7px"></div>');[/code]

in your dashboardmod.php file...

173 months ago
Jcow Master (@falcone)
Join date: Sep 2nd 2010
Community posts: 917
View Profile
Send Message

[code]
$lblocks[] = array('title' => t('Hello'),'content' => 'Put Stuff Here');
$lblocks[] = array('title' => t('Quick share'),'content'=>stream_form($client['id']).'<div style="height:7px"></div>');
$lblocks[] = $this->newsfeed(10);

[/code]

or

[code]
$output = 'Put Stuff Here';
$lblocks[] = array('title' => t('Hello'),'content' => $output);
$lblocks[] = array('title' => t('Quick share'),'content'=>stream_form($client['id']).'<div style="height:7px"></div>');
$lblocks[] = $this->newsfeed(10);

[/code]

173 months ago
AL (@switch48)
Join date: Sep 1st 2010
Community posts: 450
View Profile
Send Message

there you go johnd done Cheers Falcone :)

173 months ago
John D (@johnd)
Join date: Oct 29th 2010
Community posts: 132
View Profile
Send Message

Thank you both very much!

It is working on my site :)
I wanted to know if I can add in a script within the text for the output?

What I am wanting to do is add in an RSS news feed in the dashboard (And also the home page for users not logged in).

I have already added in a box with normal text and that worked great :)

Thanks once again for the help, really appreciated.

173 months ago
1 2 Next