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

Re: Start / community page

Reply #16

Button set to active:

your Button (sample)
Code: [Select]
            'mypage' => array(
                'title' => $txt['mypage_page'],
                'href' => $scripturl . '?action=mypage',
                'data-icon' => '',
                'show' => true,
            ),

open root/source/Subs.php
find
Code: [Select]
	elseif ($context['current_action'] == 'moderate' && $context['allow_admin'])
$current_action = 'admin';

add after
Code: [Select]
	if ($context['current_action'] == 'mypage')
$current_action = 'mypage';






Last Edit: August 22, 2015, 02:21:23 am by wintstar
Regards Stephan

Re: Start / community page

Reply #17

I found the bootstrap panels! Wow, bootstrap is fantastic! Thanks for this tip!  :)

Re: Start / community page

Reply #18

The action doesn't work, @wintstar

When I use exactly your code the page isn't found (home.php) and the forum index is shown, but the button works and is active then.

When I change the target in Subs.php from $scripturl . '?action=mypage', to the URL, the page is shown, but the button is not longer active then.

What a mess.  :-[

Re: Start / community page

Reply #19

Quote from: Jorin – The action doesn't work, @wintstar

When I use exactly your code the page isn't found (home.php) and the forum index is shown, but the button works and is active then.

When I change the target in Subs.php from $scripturl . '?action=mypage', to the URL, the page is shown, but the button is not longer active then.

What a mess.  :-[

your page must be http://.../index.php?action=start

example: http://forum-alternative-antriebe.de/index.php?action=start
Sorry for my English

Re: Start / community page

Reply #20

Quote from: Jorin – The action doesn't work, @wintstar

When I use exactly your code the page isn't found (home.php) and the forum index is shown, but the button works and is active then.

When I change the target in Subs.php from $scripturl . '?action=mypage', to the URL, the page is shown, but the button is not longer active then.

What a mess.  :-[

@Jorin this is a sample. You have to adjust the parameters. Please display your code of the button in Subs.php

mypage = set to your page (home, start ...)


Regards Stephan

Re: Start / community page

Reply #21

Quote from: wintstar – Since further .css classes are still imported.

home.php at line 14
Code: [Select]
$context['html_headers'] = '
    <link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.css" />
    <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">

I have a conflict with the style forum
Sorry for my English

Re: Start / community page

Reply #22

Quote from: inter –
Quote from: wintstar – Since further .css classes are still imported.

home.php at line 14
Code: [Select]
$context['html_headers'] = '
    <link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.css" />
    <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">

I have a conflict with the style forum

That's why I prefer my solution => http://www.elkarte.net/community/index.php?topic=2846.msg19475#msg19475The recommended by  emanuele do not match the files the current version of ElkArte.
Regards Stephan

Re: Start / community page

Reply #23

@wintstar, see in attach
Sorry for my English

Re: Start / community page

Reply #24

@inter , my english is also not the best ;)

The problems with the recommended method of emanuele with home.php is that not all are involved .css and scripts. Added to this is the 2 other .css (font-awesome.css andbootstrap.min.css) files are included. font-awesome.css is already involved with the original Theme. Look in the folder root/themes/default/webfontes. In order to eliminate these bugs, must home.php be adjusted. This means that for me this method to intigrieren an additional page not in question. Watch my demo at http://elkarte.scaricare.de/. These things I have achieved with my method. Because such bugs are excluded.

Regards Stephan


Re: Start / community page

Reply #26

I'm note entirely sure it works as expected (short on time), but the attached addon[1] 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.

Oh, yes: it may be very buggy! :P

ETA: I didn't put a page title...
Not too difficult, in HomePage.controller.php, add to the function action_homepage something like:
Code: [Select]
$context['page_title'] = 'this is the title';
If anyone wants to pick up the development is very, very welcome!
Bugs creator.
Features destroyer.
Template killer.

Re: Start / community page

Reply #27

Quote from: wintstar – @Jorin this is a sample. You have to adjust the parameters. Please display your code of the button in Subs.php

mypage = set to your page (home, start ...)

Of course I did. Didn't forget to edit the text I copied, sorry. In my files my action is called the same as my file name.  :-[

Code: [Select]
// Eigene Button für die Community.
 'start' => array(
 'title' => 'Community',
 'data-icon' => '',
 'href' => $scripturl . '?action=start',
 'show' => true,
 'sub_buttons' => array(
 'shoping' => array(
 'title' => 'Shops',
 'show' => true,
 'sub_buttons' => array(
 'shop1' => array(
 'title' => 'Amazon-Partnerlink',
 'href' => 'http://www.amazon.de/?&tag=diehybrpilo-21',
 'target' => '_blank',
 'show' => true,
 ),
 'shop2' => array(
 'title' => 'Shirtinator-Shop',
 'href' => 'http://hybrid-piloten.shirtinator.net/',
 'target' => '_blank',
 'show' => true,
 ),
 ),
 ),
 'stromtankstellen' => array(
 'title' => 'Stromtankstellen',
 'href' => 'http://elektro-piloten.de/map.html',
 'target' => '_blank',
 'show' => true,
 ),
 ),
 ),

Code: [Select]
elseif ($context['current_action'] == 'moderate' && $context['allow_admin'])
 $current_action = 'admin';
 if ($context['current_action'] == 'start')
 $current_action = 'start';

Also I changed the filename of the two new files from home.php and home.css to start.php and start.css so it is the same as my action name.

But: a click on the community titled button leads not to my start page but  to the forum index. It seems something is missing which tells ElkArte which URL it has to open when clicking on the start page button (called "community" for those of you who will test it here).


Re: Start / community page

Reply #29

I didn't made point 1 also. All I did was changing Subs.php the way I posted above.

I am really no programmer. Maybe I should start again with your linked manual (big thanks for that!) and make all points there?