Skip to main content
Topic: Start / community page (Read 19882 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: Start / community page

Reply #30

Doesn't work, @wintstar. I made all the changes you posted here, and all I get now is this:

QuoteFatal error: Call to undefined method start_Controller::action_start() in /www/htdocs/xyz/hp_elkarte/sources/controllers/start.controller.php on line 32

Line 32 is:

Code: [Select]
public function action_index()
{
$this->action_start();
}

My action is named "start", I changed this in all your code (I hope).  :-\

Re: Start / community page

Reply #31

@Jorin

Spoiler (click to show/hide)
Sorry for my English

Re: Start / community page

Reply #32

Okay, guys, thank you very much for all your hints and guides. But...  :-[

I made all steps backwards.  O:-)  I will explain why...

First my forum wasn't shown for tonight. Maybe, please don't be offended, any code listed here had an error in it, or I did a mistake while editing the files, I don't know. Normally I am very concentrated and precise when I edit code. I fixed it now, but I now (with emanuele's solution of only two new files) have the same problem as before:

I can access my start page, but the button isn't active.

That's my one and only problem. I wish there would be a solution without editing source files too much, because I think that then I have to be careful with every ElkArte update and maybe I have to make these changes then again. I don't want to.

Is there any way to get the button working without making changes to source files?

Please be patient with me. When you need 10 minutes to read and understand code, I need an hour for it.  :-X

Re: Start / community page

Reply #33

O_o

It may be I used the 1.0.5 code and there may be a new hook around...
I have to check again the code.
Bugs creator.
Features destroyer.
Template killer.

Re: Start / community page

Reply #34

Would be great!

Re: Start / community page

Reply #35

hmm...

I just installed the addon at http://www.elkarte.it/community/ and, as far as I can see, the "home" button is properly highlighted... *headscratch*.

Can you go to admin > maintenance > forum maintenance > integration hooks and check if you see the following entries?

integrate_action_frontpage    Function: integrate_action_frontpage
Included file: /.../sources/HomePage.integrate.php

integrate_actions    Function: integrate_actions
Included file: /.../sources/HomePage.integrate.php

integrate_current_action    Function: integrate_current_action
Included file: /.../sources/HomePage.integrate.php

integrate_menu_buttons    Function: integrate_menu_buttons
Included file: /.../sources/HomePage.integrate.php
Bugs creator.
Features destroyer.
Template killer.

Re: Start / community page

Reply #36

Quote from: emanuele – I'm note entirely sure it works as expected (short on time), but the attached addon should create a fully fledged home page completely integrated into the forum. Mostly the same as the one here at elk.net, but not spread over different pieces (here we have one file for the home, one for the button, etc.).

The template goes in HomePage.template.php (you didn't guess for sure! :P), if you want a particular css loaded, you can put it into the theme folder and load it from HomePage.controller.php with loadCSSFile, what else?
Dunno.

Okay, I installed your addon. But I have some problems with it and need help.

1. Where can I add submenu entries to the new button? I did not found the button in Subs.php.  :o  :-[

2. How do I include my own CSS file? I opened HomePage.controller.php and am now very confused. And it must include Bootstrap and FontAwesome. I made my template with these two services but my design is not shown anymore (because the links to their CSS service is missing).

3. I now have two footers.  :o

4. The first entry of my navigation bar leads to the home page (URL is index.php), but should lead to the forum index in my opinion.

See the start site after addon installation please.

But hey: the button works now, yippie!  :D

Edit: I can provide FTP and admin access if anyone would be so great to help me out.  :(

Re: Start / community page

Reply #37

Okay, now I worked on it and I have a functioning start site. No CSS problems any more, all is looking good. The only question is now (and hopefully this will be my last in this thread):

What's the easiest way to create a menu button? Simply edit Subs.php like I used to? Or is there any way else, a better way, without editing source files like Subs.php? If I remember right someone mentioned hooks anywhere, but I can't find it.

Re: Start / community page

Reply #38

Perfect. For mobile view you have hidden the button for the startpage. I once made a screenshot of it, make with WP Lumia 535.
Last Edit: August 25, 2015, 12:09:19 pm by wintstar
Regards Stephan

Re: Start / community page

Reply #39

Arrrrgh!!
Sorry, I read it this morning on one computer, I thought I answered and marked it as read, but instead I left it open there and I missed it!! :-[ :-[ :-[
I'm very sorry...  :-[
Bugs creator.
Features destroyer.
Template killer.

Re: Start / community page

Reply #40

No problem.  :)

Maybe you can help me with my last two problems?

1. I need some menu buttons (some of them need to be active when opening the linked page as they are pages or posts inside the baord).

2. On mobile devices my menu icons on my start page are too small (but their background seems to be okay). I think I need to add the CSS code for the mobile buttons into my start.css used for this page. I tried already but without success.

Maybe it is a good idea to create a kind of knowledge base on ElkArte.net? I had something familiar back with SMFPortal.de. There could be "articles" describing some often asked questions and their solutions, such as "adding a menu button" or "how to install ElkArte". Just the basics. So such solutions will be easy to find for us all and you don't have to answer them again and again.

Re: Start / community page

Reply #41

I found this part in GoogleMapIntegration.php, which seems to be the right place to start with building a how-to how to add menu buttons:

Code: [Select]
/**
 * integrate_menu_buttons
 *
 * - Menu Button hook, called from subs.php
 * - used to add top menu buttons
 *
 * @param mixed[] $buttons
 * @param int $menu_count
 */
function imb_googlemap(&$buttons, &$menu_count)
{
global $txt, $scripturl, $modSettings;

loadlanguage('GoogleMap');

// Where do we want to place our button (new menu layout, this needs to be redone)
$insert_after = empty($modSettings['googleMap_ButtonLocation']) ? 'memberlist' : $modSettings['googleMap_ButtonLocation'];
$insert_after = 'memberlist';

// Define the new menu item(s), this will call for GoogleMap.controller
$new_menu = array(
'GoogleMap' => array(
'title' => $txt['googleMap'],
'href' => $scripturl . '?action=GoogleMap',
'show' => !empty($modSettings['googleMap_Enable']) && allowedTo('googleMap_view'),
)
);

$buttons['home']['sub_buttons'] = elk_array_insert($buttons['home']['sub_buttons'], $insert_after, $new_menu, 'after');
}

Seems there only must be changes made if the location of the button is different. I can't write code so I don't want to write an example how-to for this, but maybe someone of you can?

Re: Start / community page

Reply #42

I'll have a look this evening (sorry, but daytime is becoming terribly busy... *rolleyes*).
Bugs creator.
Features destroyer.
Template killer.

Re: Start / community page

Reply #43

No problem!  :)

Re: Start / community page

Reply #44

Quote from: Jorin – 1. I need some menu buttons (some of them need to be active when opening the linked page as they are pages or posts inside the baord).
hmm...
So you mean you want to have a button that points for example to:
http://www.elkarte.net/community/index.php?topic=2846.0
and when inside that topic, the button should be highlighted?

Quote from: Jorin – 2. On mobile devices my menu icons on my start page are too small (but their background seems to be okay). I think I need to add the CSS code for the mobile buttons into my start.css used for this page. I tried already but without success.
Is there a live version to have a look to?

Quote from: Jorin – Maybe it is a good idea to create a kind of knowledge base on ElkArte.net? I had something familiar back with SMFPortal.de. There could be "articles" describing some often asked questions and their solutions, such as "adding a menu button" or "how to install ElkArte". Just the basics. So such solutions will be easy to find for us all and you don't have to answer them again and again.
Yep, that could be an interesting project!
Would a board do as a quick solution to start having this kind of informations written down?
Bugs creator.
Features destroyer.
Template killer.