Jump to content

Vikestart

Members
  • Posts

    13
  • Joined

  • Last visited

Posts posted by Vikestart

  1. Actually, I've managed to come up with a very elegant solution now, and would like to share it. :)

    I've added a Page field (multiple options) to the template (for the pages that have lists of pages on them).

    Then I added the following code to the template file:

    $stories = $page->children();
    if ($page->pageimport) { $stories->append($page->pageimport); }
    $stories = $stories->sort("name");

    pageimport is the name of the Page field I mentioned above.

    Now you can select pages that you want to import and display as 'fake' children of other pages. :)

    • Like 2
  2. Thanks for the input. :)

    I found another solution though, so I thought I'd share it.

    $stories = $page->children("sort=-date");
    $stories->append($pages->get("/thrillers/")->find("template=horrorthriller"));

    It may not be optimal, but it's short and it works :P

    • Like 1
  3. Thank you, that's useful info. :) I think I didn't explain the case well enough though.

    Basically, in most cases, it's okay for the pages to only have 1 parent and only appear in 1 list on 1 page.

    However, some pages need to be listed on multiple parent pages.

    Something like this:

     

    Home

    ---- Horror movies

    --------- A horror movie

    --------- Some horror/thriller movie

    ---- Thriller movies

    --------- A thriller movie

    --------- Some horror/thriller movie

     

    So let's say Some horror/thriller movie has Horror movies as its parent. How can I make it appear on the Thriller movies page as well, along with that pages other children?

    Maybe you already answered this, but do you have a concrete example? :P

  4. I need certain posts to appear on multiple pages.

    I use the following code to outpot lists of pages on the category pages:

    <?php $stories = $page->children("sort=-date"); if ($stories->count > 0) { ?>
    	<div class="cntbox_list">
    		<?php foreach($stories as $story) { ?>
    			<div class="cntbox_list_item">
    				<a href="<?php echo $story->url; ?>" class="cntbox_list_title"><?php echo $story->title; ?></a>
    			</div>
    		<?php } ?>
    	</div>
    <?php } ?>

    How can I make a post appear in multiple lists like that?

  5. Setting the defaultGamma option to 0.5 instead of the default 2.0 seems to have fixed the image quality.

    $config->imageSizerOptions = array('upscaling' => true, 'cropping' => true, 'quality' => 100, 'sharpening' => 'none', 'defaultGamma' => 0.5);

    Thanks for the help everyone! :D

    • Like 2
    • Thanks 1
  6. 18 minutes ago, Robin S said:

    What's up is that the size() method accepts a 'quality' setting in its $options array: https://processwire.com/api/ref/pageimage/size/

    And you can define the default quality setting used for the image sizer in /site/config.php via $config->imageSizerOptions: https://processwire.com/api/ref/config/

    Oooh, I didn't even know about that config.php file and that list of settings you linked to is certainly useful. :)

    Still getting to know Processwire. I'll just dive in and see where this gets me :) Thanks!

  7. What is up with the quality of images when they are resized? Is there anything that can be done to increase the quality?

    Compare the two:

    Original:

    APieceOfTheRoad.jpg.926de80d94550822fb93b3e93da4d6cd.jpg

     

    Resized (barely smaller):

    apieceoftheroad.800x344.jpg.4d6f734b9294526e97f057d716e7e1f3.jpg

     

    The quality loss is enormeous, especially in dark areas of the image.

  8. 2 minutes ago, Macrura said:

    one way would be with jquery; another way would be with a textformatter applied to the rte field, in which you could use something like simple html dom parser, to wrap those....

    I know I could do it with jQuery, but I don't want to use Javascript because then there is a delay before the changes are applied, and since this is needed for CSS styling, the delay would be very obvious.

    As for the second method you describe, I have no idea what any of that means :P Care to elaborate? ^_^

  9. Hey,

    I'm just starting out with Processwire, coming from WordPress, and I'm really happy with this CMS so far. :)

    However, I have been searching the internet for hours now without finding an answer to this:

    How can I have images automatically wrapped inside div tags?

    An alternative would be to give the parent <p> tag a specific class. I just need to control the parent of the image tags for styling purposes.

×
×
  • Create New...