Jump to content

janlonden

Members
  • Posts

    45
  • Joined

  • Last visited

Posts posted by janlonden

  1. Here's a couple of problems I need help with.

    I have a schedule page with a repeater field which has besides other fields a date field. Right now it displays all items. What I would like it to do is to only show future items and todays item.

    The code I'm using:

    <?php foreach($page->schedule as $schedule_item) { ?>
    	<p><?=$schedule_item->schedule_date?></p>
    	<p><?=$schedule_item->location->title?></p>
    <?php if($schedule_item->location->location_url) { ?>
    	<p><a href="<?=$schedule_item->location->location_url?>">Karta</a></p>
    <?php } ?>
    	<p><?=$schedule_item->starts?></p>
    	<p><?=$schedule_item->ends?></p>
    <?php } ?>
    

    I would also like a "next schedule item" thingy on the homepage, which would only show the next item on the schedule or todays schedule.

    Any help appreciated!

    Edit:

    I found help on a couple of threads here :)

    Here's how I got it working. Show only future items and todays item:

    <?php
    $today = strtotime(date("Y-m-d") . " 00:00:00");
    foreach($schedule_items = $page->schedule->find("schedule_date>=$today") as $schedule_item) { ?>
    

    To show only one item on the homepage I just added limit=1:

    <?php
    $today = strtotime(date("Y-m-d") . " 00:00:00");
    foreach($schedule_items = $pages->get(1007)->schedule->find("limit=1, schedule_date>=$today") as $schedule_item) { ?>
    
  2. oh ok. Well, if the breadcrumb always starts with [home icon] > Admin >, then I think the home icon is enough. The "Admin" part states that you're inside the admin, so it makes sense for the home icon to have the "view site" functionality. No need for two buttons, imo. Thanks for clarifying!

    I still think it's not clear enough. I remember the first time when I looked at the breadcrumb and thought "I wonder what that home icon does". I was surprised to end up in the site.

    Edit:

    It seems that adrian agrees with me, hehe :)

    • Like 1
  3. Looks great! Can't wait to have this on my site. The only thing I'm

    missing (as far as I can tell from the screenshots) is a global link to

    "View site". I think it's a major usability benefit to be able to

    quickly access your site from anywhere in the admin. Might I suggest a

    small icon the right of the "Profile" icon in the menu bar?

    The home icon in the breadcumb functions as the "View site" button right now. But I agree with you that it should be elsewhere, and have it's own icon.

    • Like 1
  4. Manfred, those were some nice skins. Thank you. I decided to use the bootstrap one.

    I would love to use version 4, but I think I'll have to wait for Ryan to update to it. Or have you managed to update to version 4?

  5. Is there a way to control tag useage like in tinymce with the valid elements option? The extra allowed content option seems to be as the name suggests, just a second layer of control.

    I would like to restrict the tags to just the basics. I would also like to force some values to my headings, which I accomplished in tinymce like this:

    h2[role:heading|aria-level:2]
    

    I searched the documentation, which wasn't to much help at all.

  6. I'd love to see screenshots of these, as I can't see that here (Firefox

    24 in OS X). I think the screenshots you attempted to post were probably

    not JPG/PNG/GIF, given the error message the forum gave you. Please

    convert them to one of those formats and post. Or if you don't want to

    convert, just email to me ryan at processwire dot com.

    Sorry, same problem. Tried with jpg and png. I'll email them.

  7. Not sure I understand–can you clarify which submenu items you are

    talking about (in the page list maybe)? Anyone else agree? What I was

    gathering from previous feedback was that folks wanted page list actions

    that were bigger and less subtle, so making them look a little more

    like buttons was the intent here.

    The border radius is now gone from the sub menus in the new version ^-^

    The new font looks a little "jagged" here on firefox, as if it's not being displayed at it's recommended size. Also I found a strange visual behavior on select elements when hovered on.

    I tried to post screenshots but it wouldn't let me? I get a message that says: "You are not allowed to use that image extension on this community."

    Anyway, I'm really happy with the new theme.

    • Like 1
  8. We really appreciate this Ryan. I like the bigger font size and added padding. The futura color theme matched the company's website I'm working on right now almost perfectly :)

    One thing that still bothers me a little is the rounded corners on submenu items when hovered over with the mouse. Not a big thing, but still wanted to give a little constructive criticism.

    Thank you for your work!

  9. ProcessWire is not a corporation so we don't have corporate colors. :)

    But we do have brand colors, and I think we will stick to them for our

    branding and marketing. But I'm feeling like the application itself

    should be less branded...  would rather have people think of it as a

    tool like their text editor. It bothers me that a seemingly large group

    of people have ignored ProcessWire largely because they don't like the

    way the admin looks. And the colors are one of the first things

    mentioned. Many of potential audience thinks they look childish: light

    blues and pink, which are also known as baby boy and baby girl colors. I

    like the colors myself (a lot), but have heard it enough objections to

    know it's not an isolated opinion. Those people aren't here to tell us

    about it in the forums because they were turned off by subjective things

    before they got to know why it would be a great tool for them. So I

    wonder if the admin needs to be more neutral and not defined by colors

    or brand, but by its usefulness as a tool. I want people to focus on the

    tool and not on the colors, because the colors really have nothing to

    do with the tool at all. While there has to be default, it should be

    fairly neutral and easy to change. Ideally it would be selectable from

    the installer so that it's clear from the beginning that it's a tool to

    get stuff done more than a brand to buy into. By the same token, I

    wonder if there shouldn't even be a PW logo in the admin, or if we

    should make it something the user can easily replace with their client's

    logo.

    Yes! I also think that the admin should be as neutral design wise as you said as possible. A good example of this is Nico Knolls Dark Business, appy, clean and neutral design.

    • Like 1
  10. Edit any template, click to the "family" tab, and choose at least one template for "allowed templates for parents". A new option will appear that says "Show in the add-page shortcut menu?". It also includes description text that states the following:

    Conditions required for this to work
    1. You must select a parent template (see: "allowed templates for parents" above). If more than 1 is selected, only the first will be used.
    2. The selected parent template must have defined this template as one allowed for children.
    3. There may only be one instance of a page using the parent template in your system.  
    4. The admin theme must support this feature.

    If you are used to using family settings to limit what pages can go where, then you'll find that the above conditions match up with what you'd usually do. Meaning, PW will auto-discover what templates can be shown in the shortcut menu. If it's showing something you don't want it to, then you can turn it off by selecting "No" in the shortcut menu question for any of those templates. 

    Got it. Thanks!

    #masthead, #notices, #content, .ui-dialog {
      font-size: 1.3em;
    }

    Ahhh. Much better with 1.6em :) Even though some margins and paddings are proportionally too small.

  11. Wow! Thank you Ryan. A big improvement from the old theme.

    I get this message when I press the "Add new" button: "Not yet configured: See template family settings."

    What am I supposed to do in the "Family" tab?

    One more thing, I would like the base font size to be larger. Right now I have to squint to see some texts. Maybe it's just me but I like large font sizes. Is there a way to easily increase the base font size?
     

  12. I've been looking at PHP frameworks and considering learning one to make apps. I've been reading some Laravel tutorials and it seems like even I could propably make some simple apps in it :D But then I thought it might be possible and easier with ProcessWire.

    Here's my question. Is it possible to have a login form as your homepage which redirects you to a custom page where I can have complete control of the output? Lets say I wanted to create a simple todo app. There would only be a list of items and a create new/delete buttton. This would make all the database, field, users management so much more convenient compared to other frameworks.

    If this is possible please point me to some tutorials or code examples if you've done something similar yourself.

    Thanks.

  13. Hi thank you for such qucik answer.

    From code u give me i get this:

    test WINDOWS server for locales
    
    Preferred locale for english GB on this system is 'English_United Kingdom.1252'
    Friday 22 December 1978
    
    Preferred locale for english USA on this system is 'English_United States.1252'
    Friday 22 December 1978
    
    Preferred locale for german on this system is 'German_Germany.1252'
    Freitag 22 Dezember 1978
    
    Preferred locale for spanish on this system is 'Spanish_Spain.1252'
    viernes 22 diciembre 1978
    
    Preferred locale for dutch on this system is 'Dutch_Netherlands.1252'
    vrijdag 22 december 1978
    
    Preferred locale for polish on this system is 'Polish_Poland.28592'
    pi�tek 22 grudzie� 1978 
    

    the last one is in polish but without polish chars.

    My code looks like this:

    
    echo "<div class='span2'>".
    	"<div class='que'>{$e->que}<p>KOLEJKA</p></div>".
    	"<div class='date'>{$e->date}</div>".
    	"</div>".
    	"<div class='span2'>".
    		"<div class='team1'>".
    			"<div class='pic'><img src='{$e->logo1->url}' alt='{$e->title}' /></div>".
    			"<div class='name'>{$e->team_name1}</div>".
    			"<div class='table'>w tabeli: <span>{$e->team_table1}</span></div>".
    		"</div>".
    		"<div class='versus'>VS</div>".
    			"<div class='team2'>".
    				"<div class='pic'><img src='{$e->logo2->url}' alt='{$e->title}' /></div>".
    				"<div class='name'>{$e->team_name2}</div>".
    				"<div class='table'>w tabeli: <span>{$e->team_table2}</span></div>".
    			"</div>".
    "</div>";
    

    My date is on the 4th row.

    what i need to do to get my date correct. Ty

    Put this in your config.php:

    setlocale(LC_ALL, 'Polish_Poland');
    

    You could try changing this:

    "<div class='date'>{$e->date}</div>".
    

    to:

    "<div class='date'>" . strftime("%e %B %Y", $e->getUnformatted("date")) . "</div>".

    I'm not a programmer so this could be totally wrong.

    • Like 1
  14. First run this on your server:

    <?php
    echo '<hr>test WINDOWS server for locales';
    
    /* try different possible locale names for english GB as of PHP 4.3.0 */
    echo '<p>';
    $loc_en = setlocale(LC_ALL, 'english_gbr', 'english_britain', 'english_england', 'english_great britain', 'english_uk', 'english_united kingdom', 'english_united-kingdom');
    echo "Preferred locale for english GB on this system is '$loc_en'";
    echo '<br/>' . strftime("%A %d %B %Y", mktime(0, 0, 0, 12, 22, 1978));
    
    /* try different possible locale names for english USA as of PHP 4.3.0 */
    echo '<p>';
    $loc_enusa = setlocale(LC_ALL, 'english_usa', 'english_america', 'english_united states', 'english_united-states', 'english_us');
    echo "Preferred locale for english USA on this system is '$loc_enusa'";
    echo '<br/>' . strftime("%A %d %B %Y", mktime(0, 0, 0, 12, 22, 1978));
    
    /* try different possible locale names for german as of PHP 4.3.0 */
    echo '<p>';
    $loc_de = setlocale(LC_ALL, 'de_DE@euro', 'de_DE', 'deu_deu');
    echo "Preferred locale for german on this system is '$loc_de'";
    echo '<br/>' . strftime("%A %d %B %Y", mktime(0, 0, 0, 12, 22, 1978));
    
    /* try different possible locale names for spanish as of PHP 4.3.0 */
    echo '<p>';
    $loc_es = setlocale(LC_ALL, 'esp_esp', 'esp_spain', 'spanish_esp', 'spanish_spain');
    echo "Preferred locale for spanish on this system is '$loc_es'";
    echo '<br/>' . strftime("%A %d %B %Y", mktime(0, 0, 0, 12, 22, 1978));
    
    /* try different possible locale names for dutch as of PHP 4.3.0 */
    echo '<p>';
    $loc_nl = setlocale(LC_ALL, 'nld_nld');
    echo "Preferred locale for dutch on this system is '$loc_nl'";
    echo '<br/>' . strftime("%A %d %B %Y", mktime(0, 0, 0, 12, 22, 1978));
    ?>
    

    It will show you what setlocale setting your server accepts. I had to use "swedish_sweden" on my local xampp server and "sv_SE" on the live server.

    In your config.php put this:

    $config->timezone = 'Europe/Stockholm';
    setlocale(LC_ALL, 'sv_SE');
    

    Modify to your needs of course.

    And finally use this to output the date:

    <?php echo strftime("%e %B %Y", $page->getUnformatted("date"));?>
    

    Hope this helps!

    • Like 2
  15. You're awesome!

    This worked:

    	if(!$error) {
    		$subject = "Kontakt formulär";
    		$message = '';
    		$headers = 'From:'.$form[epost]."\r\n".'Content-Type: text/plain; charset=utf-8'."\r\n";
    		foreach($form as $key => $value) $message .= "$key: $value\n";
    		mail($emailTo, '=?UTF-8?B?'.base64_encode($subject).'?=', $message, $headers);
    		$sent = true;
    	}
    

    Thank you!

    • Like 1
  16. I've encountered a problem with my contact form. Characters such as å, ä and ö in mails sent from the form are displayed as Ã¥, À, and ö. I'm sure it has something to do with character encoding(utf-8, iso-8859-1).

    I've googled around for a solution but couldn't find an answer :(

    Any ideas how to fix this?

    Here's my contact form code:

    // set this to the email address you want to send to (or pull from a PW field)
    $emailTo = ''; 
    
    // or if not set, we'll just email the default superuser
    if(empty($emailTo)) $emailTo = $users->get($config->superUserPageID)->email;
    
    // set and sanitize our form field values
    $form = array(
    	'namn' => $sanitizer->text($input->post->namn),
    	'epost' => $sanitizer->email($input->post->epost),
    	'meddelande' => $sanitizer->textarea($input->post->meddelande),
    	); 
    
    // initialize runtime vars
    $sent = false; 
    $error = ''; 
    
    // check if the form was submitted
    if($input->post->submit) {
    
    	// determine if any fields were ommitted or didn't validate
    	foreach($form as $key => $value) {
    		if(empty($value)) $error = "<p class=\"error\">Kontrollera att du har fyllt i alla fält.</p>";
    	}
    
    	// if no errors, email the form results
    	if(!$error) {
    		$subject = "Kontakt formulär";
    		$message = '';
    		foreach($form as $key => $value) $message .= "$key: $value\n";
    		mail($emailTo, $subject, $message, "From: $form[epost]");
    		$sent = true;	
    	}
    }
    
    if($sent) {
    	echo "<p class=\"success\">Tack! Ditt meddelande har skickats.</p>"; // or pull from a PW field
    
    } else {
    
    	// encode values for placement in markup
    	foreach($form as $key => $value) {
    		$form[$key] = htmlentities($value, ENT_QUOTES, "UTF-8");
    	}
    
    	echo $error;
    ?>
    <article role="complementary">
    	<form action="./" method="post">
    		<p>
    			<label for="namn">Namn</label>
    			<input type="name" id="namn" name="namn" aria-required="true" value="<?php echo $form[namn] ?>" required>
    		</p>
    
    		<p>
    			<label for="epost">E-post</label>
    			<input type="email" id="epost" name="epost" placeholder="du@domän.se" aria-required="true" value="<?php echo $form[epost] ?>" required>
    		</p>
    		<p>
    			<label for="meddelande">Meddelande</label>
    			<textarea id="meddelande" name="meddelande" aria-required="true" required><?php echo $form[meddelande] ?></textarea>
    		</p>
    		<input type="submit" id="submit" name="submit" value="submit">
    	</form>
    </article>
    <?php } ?>
    
  17. Like Nico Knolls Dark Business theme, this one looks amazing! I'm really glad to see more awesome admin themes popping up :)

    I really like the idea to be able to change color theme, to match the frontend design of your clients website.

    I'm looking forward to use this theme.

  18. I've been going through all the admin themes but in every case I end up deleting the templates-admin folder after a while. But this one just clicked with me instantly! incredibly clean and professional looking! Too bad there are some bugs, which make it unuseable for me.

    This happens when I open the menu:

    post-1433-0-81410400-1378322808_thumb.jp

    And this overflow/width problem:

    post-1433-0-86154300-1378322856_thumb.jp

    I would like to help fix these bugs, but I'm in a middle of a project right now, which should've been done already.

    • Like 1
×
×
  • Create New...