Jump to content

kater

Members
  • Posts

    111
  • Joined

  • Last visited

Posts posted by kater

  1. What would you suggest if images embedded with CKE come without any class?

    I need to add the "data-uk-lightbox" attribute for lightbox functionality.

    Some way to add an custom attribute only when using the "link to larger" option would be great.

    I can't add classes/attributes to article images by default (interceptor or jquery) since other things like Sponsorlogos will be linked.

    (for now i've altered the wire/modules/Inputfield/InputfieldCKEditor/plugins/pwimage/plugin.js)

    thanks.

  2. Selectorstring teaser=1 needs field 'teaser' having int value = 1

    Hi kixe,

    I should have posted the whole teaser code. The selector teaser=1 ist a checkbox to enable frontpage display for a certain (event) page. The situation also persists when i define a single item imagefield. I did not mention that the field only holds one image anyway in automatic setting. Sorry.

    The teaser works on any item in the $items array "teaserimage" field but the current. All other fields in this item work as well. When i exclude the current page from the selector (id!=$page->id), everything as expected fine.

    When i run the teaser function a second time, all same imagefields of the displayed pages return NULL.

    It seems, i cannot get a page twice without the imagefield becoming a non-object.

    function renderTeaser($template, $showdate) {
    
    	$out='';
    	$item='';
    	$items='';
    	$teaser='';
    
    	$items = wire('pages')->find($template);
    
    	if (count($items)) {
    		foreach($items as $item) {
    			$out .= '<div class="uk-width-1-1 uk-width-small-1-3">';
    
    			if ($item->externallink) {
    				$out .= '<a href="' . $item->externallink . '" title="' . $item->title . '">';
    				} else {
    				$out .= '<a href="' . $item->url . '" title="' . $item->title . '">';
    				}
    
    			$out .= '<figure class="uk-overlay">';
    			
    			if ($item->teaserimage) {
    				$thumb = $item->teaserimage->size(480,323);
    				$out .= '<img src="' . $thumb->url . '" alt="' . $item->teaserimage->description . '">';
    			}
    
    			if ($item->host){
    				$logo = wire('pages')->get("$item->host")->logo->url;
    				$out .= '<img class="teaserlogo" src="' . $logo . '" alt="' . $item->title . '">';
    			}
    
    			$out .= '<figcaption class="uk-overlay-panel uk-overlay-background uk-overlay-bottom">';
    			$out .= '<strong>' . $item->title . '</strong><br>';
    			if ($showdate==1) $out .= strftime('%e. %b.', $item->event_start) . ' – ' . strftime('%e. %b. %Y', $item->event_ende) . '<br>';
    			if ($item->template=="news") $out .= $item->summary;
    			$out .= '</figcaption></figure></a></div>';
    		}
    	}
    	return $out;
    }
    
    
  3. $thumb is the size of the image not the image itself. Corrected code above.

    thanks for your reply!

    but i'm afraid thats not the problem here.

    I've tried different approaches now and no matter if i call/loop the teaser pages via function ('wire') or at the $page template itself, (just) the imagefield from the active page is always NULL when identical with the current page.

  4. Dear Forum,

    When i'm using a function for a teaser which calls a couple pages by template - including the current, just the imagefield (limit 1, automatic) for the current page returns a NULL. All other fields or pages work. When on a page that wont be repeated in the teaser, all things smooth.

    Any hint what I'm doing wrong or some logic i dont get (again)?

    thanks alot!

    ProcessWire 2.6.1

    <div class="uk-grid uk-grid-small uk-margin-top">
    	<?php echo renderTeaser("template=event, teaser=1, limit=3, sort=sort", 1); ?>
    </div>
    
    function renderTeaser($template, $showdate) {
    
    	$out='';
    	$item='';
    	$items='';
    	$teaser='';
    
    	$items = wire('pages')->find($template);
    
    	if (count($items)) {
    		foreach($items as $item) {
    			
    			//removed stuff to shorten code for forum
    
    			if ($item->teaserimage) { 
    			$thumb = $item->teaserimage->size(480,323);
    			$out .= '<img src="' . $thumb->url . '" alt="' . $item->description . '">';
    			}
    
    			//removed stuff to shorten code for forum
    
    		}
    	}
    	return $out;
    }
    
    
  5. jQuery attr seems good to me.

    Another option may be str_replace on the output something like

    $out = $nav->render();
    $out = str_replace('class="has_children"', 'class="has_children" data-uk-dropdown', $out);

    I like your approach better. More reliable targeting. Thanks!

  6. Great module. Thanks alot.

    Another scenario (i hope i did not miss the answer in this thread):

    I'm using the Uikit framework with dropdowns which requires an attribute "data-uk-dropdown" after the "has_children_class". Please see example.

    Any idea how to add this using given module options? (using jquery .attr now).

    thanks!

    <nav class="uk-navbar">
    
    <ul class="uk-navbar-nav">
       <li class="uk-active"><a href="">Active</a></li>
       <li><a href="">Item</a></li>
       <li class="uk-parent" data-uk-dropdown>
           <a href="">Parent <i class="uk-icon-caret-down"></i></a>
    
           <div class="uk-dropdown uk-dropdown-navbar">
           <ul class="uk-nav uk-nav-navbar">
               <li><a href="#">Item</a></li>
               <li><a href="#">Another item</a></li>
               <li class="uk-nav-header">Header</li>
               <li><a href="#">Item</a></li>
               <li><a href="#">Another item</a></li>
               <li class="uk-nav-divider"></li>
               <li><a href="#">Separated item</a></li>
            </ul>
            </div>
    
         </li>
    </ul>
    
    </nav>
    
  7. I'm currently discussing a project where we'd need some sort of automated, smart id/indexing to meet internal documentation standards.

    Having this available as premade field may be very useful for many.

    1) searchable

    2) bind counting to template & case or sitewide

    3) allow some smart pattern programming or excel-like logic: like range, steps, numbers, strings, external fields, time, day, month, rules, ....

    4) example: invoice_2015-01-25_123_customername

    5) optional overrideable with continuation or filling gaps

    7) error states for overrides? (like exists, out of range, ...)

    8) optional as array if it makes sense (not for me atm).

    cheers!

  8. thanks for your replies.

    it's only a couple images per article (once every few weeks). so once the thumbs/downloadable images sizes are generated the server should do ok? however, rebuilding the thumbs/cache will certainly cause some stress.

    guess i will try to find a way to generate various files while uploading. the users receive the original files from the photographer but depending who's in charge, resizing for web and uploading the original in various sizes in seperate fields will challenge some ;)

    cheers!

  9. Since PW API handles image resizing so nicely, i think of using original images (up to 15MB) on archive articles for whatever "retina"/download/... reason the client might come up at a later point.

    The images did not display in the backend view due "not enough memory" until i set PHP momory limit to 256MB. No other testing issues yet but i have only 5 pages rather than hundreds. Webspace is plenty.

    Do you see any problems here performancewise?

    thanks!

  10. Hi forum,

    Thanks for PW and to all people making it so great!

    I'm planning a multilanguage "multi-site" which will will double as project-archive for an cultural institution. So i expect it will run many years with only crucial core updates (and changing admins). So i will try to keep it as 3. party module-independent as possible. Also, i'd stick with PW commercial modules procache, listerpro and proforms to maintain the most simple and reliable update route possible.

    However, not having done this in PW yet, i have some questions.

    www.basesite.com (Portal-like frontend)

    - all-projects (300+)

    - all-news / press releases

    - links to institutions (incl. Institution1 and a couple others)

    - information pages

    www.institution1.com

    - specific projects (pulled from all-projects)

    - specific news (pulled from all-news / press releases)

    - information pages

    - a couple contact forms, ...

    Information Systems

    - feed to some Information screens from all-projects, most likely rss. no details yet.

    Projects and news will be maintained through the Base-Site.

    All multilanguage (2-3) frontends will be largely independent layouts.

    My questions:

    1) Is the core-packaged multisite module considered a longterm solution supported by PW or is there something on the roadmap which may require changes to the API?

    2) Will said modules / plugins support multilanguage / multisite in above scenario?

    3) Anyone had a similar project and ran into problems i might consider?

    thanks and cheers!

  11. Looks awesome. The Pagetree is not everyones love, especially for those coming from joomla an the likes.
    Any chance for a frontend filter that would be customizable through the same Lister Pro Module?

    • Like 2
  12. Hi,

    Strange Problem here:

    PW 2.5.3, PageClone 1.0.2, MySQL 5.6.17 (AMPPS), PHP 5.4.28

    After cloning a parent page + children with Page Clone, PW ignored all sorting settings under (parentpage) children / sort settings on the frontend. PW started ignoring ALL sortings like menues etc.

    Did i miss something here?

    works:

    $pages->get('/themen/')->children();

    ignores sorting settings unless call by API (fx sort=title):

    $pages->find("parent=themen");

    - DB entries were repaired and sort field was populated properly (get works flawless).

    - Everything worked until i cloned the page + children (and changed settings / name to something sensible)

    - I triple checked parent page settings and template settings für sorting defaults.

    - Deleting/Adding  pages will obviously not fix it. I'm not using $pages->find now.

    - Certainly no browser / cache etc issues.

    - It will not save the "manual drag & drop" setting but i'm not sure if it did before. Any other choice will save work with $page->get.

    Any suggestions?

    thanks!

  13. *facepalm*

    $thisyr=date(Y);
    			$nxtyr=date(Y)+1;
    			$aftnxtyr=date(Y)+2;
                echo "<h1>{$page->title}</h1>";
                echo $thisyr;
                foreach($pages->find("event_ende|event_daterepeater.event_ende>=01/01/$thisyr,event_beginn|event_daterepeater.event_beginn<01/01/$nxtyr") as $s) {
                
                echo "<li><a href='{$s->url}'>{$s->title}</a>, {$s->event_beginn} - {$s->event_ende} | {$pages->get("$s->event_location")->title}</li>";
                
                foreach($s->event_daterepeater as $sr) {
                echo "<li><a href='{$s->url}'>{$s->title}</a>, {$sr->event_beginn} - {$sr->event_ende} | {$pages->get("$s->event_location")->title}</li>";
    	        }}
                
                echo "</br>Vorschau $nxtyr";
                foreach($pages->find("event_beginn>01/01/$nxtyr,event_beginn<01/01/$aftnxtyr") as $s) {
                echo "<li><a href='{$s->url}'>{$s->title}</a>, {$s->event_beginn} - {$s->event_ende} | {$pages->get("$s->event_location")->title}</li>";
                }
    
  14. Hi,

    I'm doing something wrong here:

    I have following structure for an event page that allows for multiple additional dates if neccesary and i want to display all for this year:

    EVENT

    - event_begin

    - event_end

    - daterepeater

    -- daterepeater.event_begin

    -- daterepeater.event_end

    $thisyr=date(Y);
    $nxtyr=date(Y)+1;
    $aftnxtyr=date(Y)+2;
                echo "<h1>{$page->title}</h1>";
                echo $thisyr;
                foreach($pages->find("event_ende|event_daterepeater.event_ende>=01/01/$thisyr,event_beginn|event_daterepeater.event_beginn<01/01/$nxtyr") as $s) {
                echo "<li><a href='{$s->url}'>{$s->title}</a>, {$s->event_beginn} - {$s->event_ende} | {$pages->get("$s->event_location")->title}</li>";
                }
    

    Basically it works. The event page is found but the output happens only once and not for every matching entry in the repeater. Do i need a nested loop to output those (i might need it anyway to output the repeater dates but i'm still struggling with the find :) )?.

    thanks

  15. Yes i think PageTables is great and the way to go.

    However, i'll wait for the release to use it.

    This site will only live for one year so this time i just went for checkbox layout-choices in the template.

    It will render the pagelayout with one basic template / php.

    this is pretty simple and intuitive in the backend. bloats the template file a bit.

    cheers

  16. Cheers,

    I'm curious how those of you with much more experience would solve this:

    I have pages that may look like this:

    1) title

    2) large image (100% width)

    3) text (100% width)

    4) textblock  with 50% width image

    5) 10 images as gallery (5col 2 rows)

    6) text (100% width)

    Those "elements" are freely choose- and stackable.

    However, i want to use plain text fields rather than html textareas.

    Very much like repeatable layout-modules in mailchimp templates.

    How would you approach this?

    My first idea was to use a parent page as article wrapper and output child pages which are based on individual templates. However, this negates the awesome simplicity of pw and might cause problems with searches.

    thanks!

  17. Hi owzim,

    thanks for your reply.

    Maybe i should add, i installed multilanguage support after setting up the site & using hanna codes.

    So your Hanna code does not work when executed through the text formatter but everywhere else? What's that code snippet you posted? Is that what you entered in the Hanna code php field? What's that php closing tag doing there? That might break the whole thing.

    Yes, exactly. The pasted code works everywhere but through Hanna text formatter after i installed multilanguage support. Multilanguage itself seems to work properly.

    I removed the closing tag but with no difference.

    AFAIK you don't enter opening and closing tags in the Hanna code input fields.

    Yes, thats right. Unfortunately, i guess my problem lies somewhere else since it seems to strip/add them anyway. Also, it did work before multilanguage.

    I am guessing right, that you are patching together a loop with the opening of the loop and the closing of the loop in two different Hanna codes?

    Just a simple loop here.

    ***

    I just figured out, the (body/textarealanguage) field seems to strip all html entities. No matter which formatters are applied and if content type: Markup/HTML is selected. Same with tinyMCE or Textarea Editor. Strip tags is disabled.

    ****

    another detail:

    the code (used with hanna) works with any other field like name instead of title (PageTitleLanguage works fine in any other usage on the site).

    echo "<li><a href='{$s->url}'>{$s->name}</a>, {$s->event_beginn} : {$s->event_ende}</li>";
    • Like 1
×
×
  • Create New...