Jump to content

remove

Members
  • Posts

    62
  • Joined

  • Last visited

Posts posted by remove

  1. @ BernardB: In some cases adding a row works for the best. You can call it a row in Bootstrap and Foundation or block-group in Pocketgrid. It all comes down to the same. I have been using Pocketgrid in the past but it didn't work for me. I actually got more and more respect for the big and proffesional css frameworks in there efforts to make websites compatible with all different kinds of devices and browsers.

    Coming from Bootstrap, Foundation brings me new powerful tools like Blog Grid and Interchange. You can use Custom download to reduce file size to a bare minimun.

  2. @DaveP: Thx, this code works perfect and will come in very handy!

    About the code: What does this line do? I doesn't make any sense to me.

    if($i == $colcount){ 

    I also found a different approach that renders the same result. I did not test it thoroughly but it looks very PW friendly. Foundation has build in a Block grid. You can split up content of a list evenly. The code becomes more simple. I believe it works with building blocks with css style float:left;width:33%.

    <div class="row">
    	<?php
    		$blocks = $page->children;
    		echo '<ul class="medium-block-grid-3">';
    		foreach ($blocks as $block) {
    			
    			echo "<li><a href='{$block->url}'>$block->title</a></li>";
    		}
    		echo '</ul>';
    	?>
    </div>
    
  3. I switched from Bootstrap to Foundation and like it a lot. It mainly got my interest because PW forum members speaks so highly of Foundation. I need some help with the following code because foundation is rendering columns differently than Bootstrap.  

    The following code creates rows with three columns automatically from children of pages. I use it to make portfolios, galleries or something like that. This code works perfect.

    <?php
    	$columns = $page->children;
    	$i = 1;
    	echo '<div class="row">';
    	foreach ($columns as $column) {
    	echo "<div class='medium-4 columns'>
    		<a href='{$column->url}'>$column->title</a>";
    
    	if($i % 3 == 0) {echo '</div></div><div class="row">';}	
    
    	else {echo '</div>';}	
    
    	$i++;
    	}
    	echo '</div>';
    ?>
    

    Foundation has a way to handle and correct incomplete rows/columns with an "end" class. So in my case I use a three column lay-out. If there are only five children my row is incomplete. In order to render completely, the last child should get a class "end", as described in the docs of foundation about incomplete rows.

    When I change this line and add the "end" class it renders fine, but than every column gets an "end" class of course.   

    echo "<div class='medium-4 columns end'>
    

    How can I add the class "end" to only the last child (last column)?

  4. @ kongondo: Thank you for your fast reply.

    I will try it out but I am considering making a fresh install because its a new blog with still a couple of artikels. The neccesarry testing should take up at least the same amount of work.

  5. @kongondo: I'am running your blog and like it a lot. At this point I would like to add the option so people can give a comment. But I installed the blog without the comment feature.

    Is it possible enable comments without starting over and install a fresh blog?

    post-2698-0-05624500-1419423006_thumb.pn

  6. Build my first PW website...., and not my last. Like PW a lot. It is fun to work with and sometimes a challenge. Spent, more than once, some ours fiddling on code issues, but real proud when I got it to work. Could not have done it without the feedback of the members from this community, thank you!

    Modules I used:

    -Email Obfuscation

    -Form Builder

    -SEO

    -Blog

    -Google Analytics

    -Protected Mode

    -Wire Mail SMTP

    Other:

    -Bootstrap

    -Animate

    -WOW

    -Unslider

    Website: http://www.tweemansterk.nl

    • Like 9
  7. I would like to do a request. Is it possible to remove the line breaks? 

    <title>titel</title><meta name="keywords" content="voorbeeld, voorbeeld, voorbeeld">
    
    <meta name="description" content="Dit is de omschrijving">
    
    <meta name="image" content="">
    
    <meta name="canonical" content="http://www.testpagina/">
    
    <meta name="generator" content="ProcessWire 2.5.3">
    
    <meta name="author" content="">
    
    <meta name="robots" content="index, follow">
    
    <meta name="og:site_name" content="">
    
    <meta name="og:title" content="titel">
    
    <meta name="og:url" content="">
    
    <meta name="og:description" content="Dit is de omschrijving">
    
    <meta name="og:type" content="website">
    
    <meta name="og:image" content="">
    
    <meta name="twitter:card" content="summary">
    
    <meta name="twitter:site" content="@">
    
    <meta name="twitter:title" content="titel">
    
    <meta name="twitter:url" content="">
    
    <meta name="twitter:description" content="Dit is de omschrijving">
    
    <meta name="twitter:image" content="">
    
    • Like 1
  8. Found the problem. The Blog page is linked to blog.php. Changed

    $content .= $blog->renderPosts("limit=$limit");
    

    to

    $content .= $blog->renderPosts("limit=$limit,true");
    

    Sorry...., dumb of me. Got to learn more about the structure of the template demo files.

    • Like 1
  9. @ kongondo: I experience a problem truncating posts.

    When I render renderPosts like you described on your blog. All posts truncate fine. When I use the included template posts will not truncate. I only altered blog-main.

    blog-main

    <?php
        $topNavItems = array();
        $templates = array('blog-archives');
        foreach ($templates as $t) {
    
            $p = $pages->get("template=$t");
            if($p->id)  $topNavItems[] = $p;
        }
        $topNav = $blog->renderNav('', $topNavItems, $page);
    ?>
    <?php include("./head.inc"); ?> 
    
    <div class="container blog-container">
    	<div class="row">
    		<div class="col-md-8">
    			<div class="row">
    				<div class="col-md-12">
    					<h2>Blog</h2>
    				</div>
    			</div>
    			<div class="row">
    				<div class="col-md-12">
    					<?php
    					$noAuthor = $pages->get('template=blog-widget-basic, name=post-author, include=all')->is(Page::statusUnpublished) ? ' no-author' : '';
                		?>		
    					<div><?php echo $content?></div>
    				</div>
    			</div>
    		</div>
    		
    		<div class="col-md-4 link6 hidden-xs" id="blog-col-sidebar">
    			<p id="zoekblog">Zoek in:</p>
    			<div id="top-nav"><?php echo $topNav;?></div>
    		</div>
    	</div>
    </div>
    
    <?php include("./foot.inc"); ?>  

    blog-posts (did not changed this template, renderpost is set to true )

        //main content
        $content = '';
        $content .= "<h2>{$page->get('blog_headline|title')}</h2>";
        //render a limited number of summarised posts
        $content .= $blog->renderPosts("limit=5", true); 
    

     This is my output

  10. @ Nico:

    I did some research for validation. Found a solution for html5 tags. Could you take a look at this please?

    http://help.simplytestable.com/errors/html-validation/bad-value-w-for-attribute-x-on-element-y-z/bad-value-twittertitle-for-attribute-name-on-element-meta-keyword-twittertitle-is-not-registered/

    Swap the name attribute for an otherwise-identical property attribute to create valid syntax
  11. @macrura: Looks very nice, but first want to solve this one.

    @jan romero: Again, thank you for your detailed answer. Very helpful. Now I understand the relation between input and the effect on the URL. Changing the URL gives a different result. This works pretty neat.

    I created a pulldown to select different categories.  

    <select name="form" onchange="location = this.options[this.selectedIndex].value;">
    	<option value="">Sort</option>
    	<option value="/testpagina/muzikanten/?selectedcategory=bassisten&sortby=title">Bassisten</option>
    	<option value="/testpagina/muzikanten/?selectedcategory=fluitisten&sortby=title">Fluitisten</option>
    	<option value="/testpagina/muzikanten/?selectedcategory=trombonisten&sortby=title">Trombonisten</option>
    </select>

    Is it possible with this setup to show all categories? I mean the result that you get without a string. 

    $categories = $page->children();
    
    $muzikanten = $category->children(); 
  12. @kize: My goal is a dropdown with sort options: all, ascending, descending, all fluitisten, all bassisten, all trombonisten. 

    @jan romero: Thank you for your thorough explanation. I still can't put the two things together.

    This code gives an Internal Server Error. I assume that the sort part works as a container. Do all links must be visible in the foreach(muzikanten as muzikant) so they can be sorted?  

    <?php
    	$sort = 'title';
    	if ($input->get->sort === 'descending')
    	$sort = '-title'; //Put a - in front to sort Z-A
    					
    	$muzikanten = $item->children("sort=$sort, sort=id"); //always sort by id to break ties consistently
    	foreach($muzikanten as $muzikant) {
    					   					   
    		$items = $page->child->title;
    		foreach($page->children as $item) {
    		$items = $item->title;
    		echo"<ul>";
    		foreach($item->children as $childchild) {
    		echo "<li><a href='{$childchild->url}'>{$childchild->title}</a></li>";
    			}
    		echo "</ul>";
    		}
    						
    	}
    ?>
    

    ...still so much to learn....

  13. I need some help, and trying to understand, how to create a select dropdown for sorting items. The goal is something like sorting on PW modules pages (included image).

    Page structure:

    Muzikanten

    -Bassisten

    --Bassist A

    --Bassist B

    --Bassist C

    -Fluitisten

    --Fluitist A

    --Fluitist B

    --Fluitist C

    -Trombonisten

    --Trombonist A

    --Trombonist B

    --Trombonist C

    Results I have created.

    All

    <?php
    	$items = $page->child->title;
    	foreach($page->children as $item) {
    	$items = $item->title;
    			echo"<ul>";
    			foreach($item->children as $childchild) {
    			echo "<li><a href='{$childchild->url}'>{$childchild->title}</a></li>";
    			}
    			echo "</ul>";
    		}
    ?>
    

    Show only a subgroup

    <?php
    	$items = $pages->get("/muzikanten/bassisten/")->children;
    	foreach ($items as $item) {
    		echo "</ul>";
    		echo "<li><a href='{$item->url}'>{$item->title}</a></li>";
    		echo "</ul>";
    	}
    ?>
    

    Eventually I would like a dropdown. How can I approach this the best way? The thing I do not understand is how a page can refresh and show selected results? Or is every result a different page? Do I need to make a tree with result pages to which the dropdown can refer too?

    post-2698-0-96947800-1418140863_thumb.pn

×
×
  • Create New...