Peter Knight
Members- 
                
Posts
1,384 - 
                
Joined
 - 
                
Last visited
 - 
                
Days Won
5 
Everything posted by Peter Knight
- 
	What I mean is (and this might be a bug).... An image field of mine has several images. Unless I crop the very first image in the image field, the selector won't work. I like to let my editor choose which image to crop. That image could be the second or third image. With this ... <img src='{$person->Images->first->getCrop('Staff-Photo')->url}'> there seems to be a quirk where PW isn't looking for the very first instance of 'Staff Photo'. It's looking for the very first image. If that image has no cop applied, I get an error. The alternative it to setup a special image field solely for each crop but that shouldn't be necessary ?
 - 
	@videokid I didn't think this mattered as you can only have one instance of a crop on any one Images field. Sure, you can have many differently sized crops but you can only cropped image based on the Staff-Crop setting? Clearly I was wrong as your code works (thanks) although I modified it slightly yo my own requirements <?php echo"<div class='row'>"; $peoples = $pages->find ("template=team-detail"); foreach ($peoples as $person){ echo"<div class='small-6 medium-4 columns'>"; echo" <div class='person-wrapper grid'> <div class='service-img'> <a href='{$person->url}'> <img src='{$person->Images->first->getCrop('Staff-Photo')->url}'> </a> </div> <strong>{$person->title}, {$person->Qualification}</strong><br/> {$person->Role} </div>"; echo"</div>"; } echo"</div>"; ?>
 - 
	
Hide/mask a parent page from front end
Peter Knight replied to Peter Knight's topic in Getting Started
Hey. I should have mentioned, it's really any/everywhere that I want to mask the parent page name. Particularly URLs and breadcrumb trails. Otherwise, thanks for the tips. I'll test during the week. - 
	Is this the proper way to call a crop called Staff-Photo in a field called Images? <?php $peoples = $pages->find ("template=team-detail"); foreach ($peoples as $person){ echo"<a href='{$person->url}'><img src='{$person->Images->getCrop('Staff-Photo')}\'></a>"; } ?> I'm getting an error as follows. I'm not sure if it's my syntax or a problem with my install. Croppable Image is installed properly and the pages I am calling in my selector all have an image with Staff-Photo crop applied.
 - 
	Have a screengrab?
 - 
	Short explanation Is it possible to hide a page from front-end output but keep the ability display it's children? Ideally I'm looking for a solution that doesn't involve htaccess or nginx So lets say I have a breadcrumb trail of: Home > News > Posts > news story 1 and I want to mask off the folder called Posts so it becomes just Home > News > news story 1 I still want to retrieve the child pages of Posts using selectors etc. Long explanation I'll give you a use case... I start off with a News section and its children are news stories. News (name=news, template=news-container) - news post 1 ( template=news-item) - news post 2 ( template=news-item) - news post 3 ( template=news-item) - news post 4 ( template=news-item) The structure above lets me use the Add New function because the Parent and Children both have very specific templates and settings. Client then tells me that there are News child pages which are not news items. Lets say they want to add pages called Public Relations Contacts, Media Enquiries and Events They need to be child pages of News but they can't go in the root. They don't need a news-item template and I don't want them to be pulled into any selectors targeting template=news-item or parent=/news/ etc What I usually end up doing is putting all the news items inside a hidden folder called Posts and redefining the Family settings to retain the Add New functionality News (name=news, template=news) - PR Contacts - Media Enquiries - Events - Posts (name=posts, template=news-container) - - news post 1 ( template=news-item) - - news post 2 ( template=news-item) - - news post 3 ( template=news-item) - - news post 4 ( template=news-item) The problem is that my breadcrumb trail looks like this Home > News > Posts > news story 1 Although it's logical and structurally sound, there's a duplicate there in terms of content. Both News and Posts pages display a list of News items. I'm probably not describing this very well but maybe you have the same issue and have a solution?
 - 
	
Pagination bug - disappearing content
Peter Knight replied to Peter Knight's topic in General Support
Thanks Wanze - 
	Wierd bug which my client just spotted... I have a global footer on my site. It's an include file pulling in three columns of page titles. Col 1 = News headlines Col 2 = PDF titles Col 3 = Video titles All three are pulled in via selectors (see below) and work perfectly across the site except for a paginated news page. Here's the bug. if you click Page 2, the footer Video titles disappear. if you click Page 3 onwards, both the footer PDF titles AND the footer video titles disappear. Here's my selectors...which work apart from p2 and p3 The main news feed <?php $pages->find("template=news_item, news_type=Investor News, sort=-news_date, limit=5"); $pagination = $results->renderPager(); foreach($results as $result) { echo "<div class=\"news-wrapper\">"; echo "<h3><a href={$result->url}>{$result->title}</a></h3>"; echo "{$result->news_summary}"; echo "<div class=\"published-date\"><span class=\"icon-meta icon-calendar-1\">{$result->news_date}</span></div>"; echo "</div>"; } echo $pagination; ?> The disappearing PDF selector <?php $studies = $pages->find("template=case-study, limit=4"); $out = ""; foreach ($studies as $study) { $out .= "<div class=\"home-casestudy-wrapper\">"; $out .= "<span class=\"icon-meta icon-document\"><a href={$study->url}>{$study->title}</span></a>"; $out .= "</div>"; } echo $out; ?> The disappearing video selector <?php $videos = $pages->find("template=video-detail, limit=5, sort=sort"); $out = ""; foreach ($videos as $video) { $out .= "<div class=\"home-vid-wrapper\">"; $out .= "<span class=\"icon-meta icon-youtube-play\"><a href={$video->url}>{$video->title}</span></a>"; $out .= "</div>"; } echo $out; ?> It seems specific to the pagination. Everything works on p1 and there are no debug errors displaying either.
 - 
	Hey Nico Any progress on this lovely CK editor skin?
 - 
	
Site broken - error in WireDatabasePDO.php
Peter Knight replied to Peter Knight's topic in General Support
Will do. Wasn't sure if it was definitely ChangeLog but now I've tried it on another test site and had same result. I've created an issue here https://github.com/teppokoivula/ProcessChangelog/issues/7 and fixed temporarily by removing module in the database. - 
	Hi guys I was installing the ChangeLog module and my site is now throwing the following error Looking at WireDatabasePDO.php line 191, I don't see anything obviously wrong but I'm not familiar with the inner workings of that file. public function exec($statement, $note = '') { $this->queryLog($statement, $note); return $this->pdo()->exec($statement); } Any ideas? Could I manually replace the Wire folder or should I look to cherry pick this fix?
 - 
	No worries. Today I exported a CSV of a content table from Modx and used the cvs importer to import into PW. All went remarkably smoothly apart from some image handling but initial attempts are very promising for text
 - 
	hi chrizz Just wondered if there was an update on this and wether it would handle importing of Revolution or only Evolution?
 - 
	
Use HannaCode to fetch an include file
Peter Knight replied to Peter Knight's topic in Getting Started
I realised that although this successfully displayed my form, it wouldn't help my client. Anything they edit and FTP into /templates/includes/ still wouldn't be reflected in /site/cache/HannaCode The suggestion by @Macrura (and probably @LostKobrakai) worked out in the end. - 
	
Use HannaCode to fetch an include file
Peter Knight replied to Peter Knight's topic in Getting Started
Permissions all check out. I manually copied my php file from /includes/ to /assets/cache/HannaCode/ and the php include works great. For some reason my other includes are auto-copied to this location (and work) but the new include wasn't. - 
	
Upgrade from 2.5.24 to 2.5.25 broke the site
Peter Knight replied to Juergen's topic in General Support
Does the same thing happen if you use the Upgrade module? - 
	Isn't it available in the Client area ? Top right of forums...click your profile name.
 - 
	
Use HannaCode to fetch an include file
Peter Knight replied to Peter Knight's topic in Getting Started
No joy with either approach. It's baffling as all my other HCs work and are in the same folder. Other HCs end in .inc. I might try start there. - 
	
Use HannaCode to fetch an include file
Peter Knight replied to Peter Knight's topic in Getting Started
Thanks gents. Will do. - 
	I'm moving a client site to PW. They've been using Dreamweaver for years and want to continue to use Dreamweaver for some elements of their site. One of these elements is a pretty complex order form (webform.php) I was considering the following A normal PW page called order would have a body field. Within this, I'd call a HannaCode called [[get-webform]] within the code of the hanna code, I'd call that webform.php as an include That'd mean the client can FTP up any changes to include/webform.php and therefore bypass PW a little for this particular element. I know an alternative would be to include the webform.php directly in the template but was wondering if above approach might work too? I've actually tried it already and am getting no output from the HC. Warning: include(/includes/webform.php): failed to open stream: No such file or directory in /var/www/vhosts/site.com/httpdocs/site/assets/cache/HannaCode/webform.php on line 3 Warning: include(): Failed opening '/includes/webform' for inclusion (include_path='.:') in /var/www/vhosts/site.com/httpdocs/site/assets/cache/HannaCode/webform.php on line 3 webform.php does exist on the server and my other includes work just fine. Some of those other includes contain PHP selectors etc.
 - 
	Based on the popularity of this, it's probably a great starting point.
 - 
	Good ideas and advice. Thanks. In truth, I actually like the manual setup and the blank slate approach but sometimes it's great to have "something I prepare earlier" too
 - 
	Anyytime I start a new PW project, I have a very repetitive process to setup the base folder with assets, database and modules. The design of new sites is something I like to keep bespoke but the following can probably be streamlined a bit download modules (config, formbuilder, listerpro, upgrade, profields etc) create folders for CSS frameworks, Jquery scripts, create includes (header, footer, navigation I'm decided to create a base prototype folder and database with the essential assets. I can cookie-cutter this rapidly and duplicate it as the basis for new projects. Just curious about other peoples process for spinning out a new PW project. Some of you probably use task runners or Git etc? It's an area I need to explore. Cheers
 - 
	One more thing. This may not be part of your Module but when I save a page with the Chosen Select field, I get some weird formatting. See top left of screen and specifically the UL ID of: <ul id="notices" class="ui-widget"> <li class="ui-state-highlight NoticeMessage ui-priority-secondary NoticeDebug"><a class="notice-remove" href="#"><i class="fa fa-times-circle"></i></a><i class="fa fa-gear"></i> Session: Change: Company_Selector_2</li> I think the width here needs to be 100% and not 100px? .ui-state-highlight.ui-state-highlight { top: 0; background: rgb(240,240,240); margin: 3px 5px 3px 0; padding: 0; border: 1px dotted gray; width: 100px; height: 19px; }
 - 
	The drag and drop reordering works lovely. Thanks for letting me know. Can I just chip in some thoughts? This is just a personal preference but I wonder if the selected items should matched the display of the normal Page Select results. IE stacked vertically with 100% width, trash icon and colored background. Then again, your way fits more selections into a smaller space.| I wonder if the drag and drop could be refined a little. When I drag a selected page left or right, I see a dotted line which I don't think is necessary. It's also only 70% height of the field too which makes it look like a mistake. It's probably a part of the original jQuery setup? Chrome has an annoying habit of trying to auto-fill the results and bringing up a selection of 'helpful' results. But really, thanks for taking time to make this. It's a really cool field and my users will love it.