Jump to content


everfreecreative

Member Since 26 Feb 2012
Offline Last Active May 23 2013 03:58 PM
-----

#35579 Module: CKEditor

Posted by everfreecreative on 22 May 2013 - 11:36 AM

Thanks Adrian & Soma. I will definitely look into that. Wish I had known about it sooner!

 

 

Edit: Hmmm, I feel kind of stupid for having to ask this, but... How do I enable the Codemagic plugin? Do I have to add a separate button to the toolbar, and does it go under "third party" or just the standard plugins?

 

Edit 2: Alright, I figured it out through trial & error :)  Add "codemagic" to the list of plugins (not third party) and then add "codemagic" to the toolbar.




#35222 Global tinymce config

Posted by everfreecreative on 17 May 2013 - 12:40 PM

And here's one for updating the CKEditor, if you're using that instead of tinyMCE:

 

<?php
include('./index.php');

$fields = wire("fields")->find("name=body|intro|sidebar");

foreach($fields as $field) {
    $field->toolbar = "
    	Format, Bold, Italic, -, RemoveFormat
    	NumberedList, BulletedList, -, Blockquote
    	PWLink, Unlink
    	PWImage, Table, HorizontalRule, SpecialChar
    	PasteText, PasteFromWord
    	Scayt, -, Sourcedialog
    	";
    $field->inlineMode = "0";
    $field->contentsCss = "/site/templates/styles/contents.css";
    $field->stylesSet = "";
    $field->extraPlugins = "pwimage,pwlink,sourcedialog";
    $field->removePlugins = "image,link";
    $field->save();
}
?>


CKEditor is now updated.



#35016 Pagebreak or Multi-page on single entry

Posted by everfreecreative on 15 May 2013 - 01:57 PM

Being able to add a custom tag in tinyMCE to create a pagebreak would be ideal for a project I'm working on. I tried out Ryan's code here, which works for splitting things up (although I discovered that I need to add a #pagebreak# at the beginning of the first page for it to work right or else it will start at page 2).

 

The problem is when it comes time to add navigation, since the resulting array is not a WireArray and thus I can't use get("limit=1") on it and then call renderPager() on the result.

 

I tried creating a new WireArray object from scratch and adding the contents of $pageBreaks to that, but it won't accept them as valid input.

 

I feel like I'm probably barking up the wrong tree with this...

 

 

EDIT:  Ok, so it looks like I just need to build my own navigation from scratch. I can see why a repeater is probably the better way to go here.

 

EDIT 2: I have it working now. The reason I had to add a #pagebreak# to the top of the page with the original code is that the page numbers start at 1 while the array was 0-based so there was a mismatch. If anyone else wants to do something similar, here's the final code from my template with my custom navigation:

 

<? 
$pageBreaks = explode('<p>#pagebreak#</p>', $page->body);
$numPages = count($pageBreaks);
$currentPage = $input->pageNum;

if($currentPage && isset($pageBreaks[$currentPage-1]))
{
  $body = $pageBreaks[$currentPage-1];
}
else 
{
  $body = $pageBreaks[0];
}
?>

<?= $body ?>

<? 
if($numPages > 1) { 
?>
  <div id="pagination-center-1">
    <div id="pagination-center-2">
      <ul id="pagination">
	        	
        <li <? if($currentPage > 1) { echo 'class="previous"'; } else { echo 'class="previous-off"'; } ?>>
          <? if($currentPage > 1) { echo '<a href="page'. ($currentPage - 1) .'">&laquo; Previous</a>'; } else { echo '&laquo; Previous'; } ?>
	</li>
	        	
        <? 
        for($i=1; $i <= $numPages; $i++) {
        ?>
          <li>
            <a href="page<?= $i ?>" <? if ($currentPage == $i) { echo 'class="active"'; } ?>><?= $i ?></a>
          </li>
        <?
	}
	?>
						
        <li <? if($currentPage < $numPages) { echo 'class="next"'; } else { echo 'class="next-off"'; } ?>>
          <? if($currentPage < $numPages) { echo '<a href="page'. ($currentPage + 1) .'">Next &raquo;</a>'; } else { echo 'Next &raquo;'; } ?>
        </li>
	          
      </ul>
    </div>
  </div>
<? 
} 
?>

 

And for complete "plug-and-play", here's my CSS for the pagination:

 

ul#pagination {
	list-style:none;
	position:relative;
	float:left;
	left:-50%;
	margin-top:10px;
}

#pagination li {
	display:block;
	float:left;
	border:0; 
	font-size:11px;
	margin-right:2px;
}

#pagination a {
	border:solid 1px #9aafe5;
	margin-right:2px;
	display:block;
	float:left;
}

#pagination .previous-off,
#pagination .next-off {
	border:solid 1px #DEDEDE;
	color:#888888;
	font-weight:bold;
	margin-right:2px;
	padding:3px 4px;
}

#pagination .next a,
#pagination .previous a {
	font-weight:bold;
} 

#pagination .active {
	background:#2e6ab1;
	color:#FFFFFF;
	font-weight:bold;
	padding:4px 6px;
}

#pagination a:link,
#pagination a:visited {
	color:#0e509e;
	padding:3px 6px;
	text-decoration:none;
}

#pagination a:hover{
	border:solid 1px #0e509e;
}


#pagination-center-1 {
	overflow:hidden;
	z-index:-1;
	height:45px;
}

#pagination-center-2 {
	position:relative;
	float:left;
	left:50%;
}

#pagination a.active {
	color:#FFFFFF;
}




#33734 Global tinymce config

Posted by everfreecreative on 25 April 2013 - 02:07 PM

Love your idea, Soma. I created a php file in the root of my site called tinymce.php which I can edit and then simply load in the browser www.mysite.com/tinymce.php to send all of the changes to all my tinyMCE fields. Here's my code for anyone who might be confused by this:

 

<?php
include('./index.php');

$fields = wire("fields")->find("name=body|sidebar|introduction|affiliates");

foreach($fields as $field) {
    $field->theme_advanced_buttons1 = "formatselect,|,styleselect,styleprops,|,fontsizeselect,forecolor,|,bold,italic,underline,strikethrough,|,hr,|,justifyleft,justifycenter,justifyright,|,bullist,numlist,|,indent,outdent,nonbreaking";
    $field->theme_advanced_buttons2 = "undo,redo,|,tablecontrols,|,pastetext,|,link,unlink,anchor,|,image,|,replace,|,removeformat,|,code,|,fullscreen";
    $field->theme_advanced_buttons3 = "";
    $field->theme_advanced_blockformats = "p,h2,h3,h4";
    $field->plugins = "inlinepopups,safari,media,paste,fullscreen,table,nonbreaking,searchreplace,style";
    $field->valid_elements = "*[*]";
    $field->content_css = "/site/templates/styles/content.css";
    $field->custom = 
    	"theme_advanced_styles:Test Style=test
    	paste_text_sticky:true";
    $field->thirdparty = "";
    $field->save();
}

 

 

The name=body|sidebar|introduction|affiliates  line selects all of my tinymce fields by name (Soma's example assumed that your tinymce fields all had tinymce_ prefixes on them, which mine do not, so I am just listing all of them out instead). It then loops through each matching field and updates each setting. Pretty cool!




#33187 Current ProcessWire Roadmap

Posted by everfreecreative on 17 April 2013 - 01:23 PM

I currently have a client who is going to have multiple editors on the website and wants the ability to preview all edits before they go live, so I'm really seeing where a more advanced draft feature would come in handy. Since they wouldn't want articles to be removed from the site while being edited, the published/unpublished system doesn't do much for them.

 

Is this something on the radar?

 

Aside from that, a simple preview button would also be handy. There is the module that does a good job of this, but last I tried it was causing bugs with the image uploader in 2.3. I think it would be really ideal to have this as a part of the core functionality, too.




#30686 New ProcessWire site with Shopping Cart

Posted by everfreecreative on 20 March 2013 - 03:17 PM

Thank you Ryan & Apeisa. You guys are the best :)  Couldn't have done it without you!




#30532 New ProcessWire site with Shopping Cart

Posted by everfreecreative on 19 March 2013 - 02:49 PM

We just launched a new e-commerce website built off of ProcessWire. We worked off of Apeisa's shopping cart module as a base and were able to get the system integrated with Authorize.net's DPM for payments. We had a to do a lot of custom programming for this client as they needed sales tax, promo codes, and different shipping rates for different zip codes. 

 

I was delighted throughout the whole process with how much I was able to tailor the editing experience for the client as well as the visitor's experience on the page. The client had several last minute requirements which we would never have been able to implement in the time we had if we were using a different CMS and didn't have PW's API and custom field system.

 

I would like at some point to release some of the new shopping cart code (shipping rates by zip code, sales tax, promo codes) to the rest of the community, but as it stands it's not modularized/generic enough and the code is in too many different pieces to make it practical. If I have time outside of work I will try to see if I can make it more distributable so that I can give back something to PW :)

 

Special thanks to Apeisa for his input when we were getting started with this.

 

http://www.harkenslandscapesupply.com/




#30483 Image upload weird issue

Posted by everfreecreative on 18 March 2013 - 10:11 PM

Ahh, that must be it. Aw, that's a shame... I'd like to be able to use it :(

Sorry for the scare, apeisa ;)


#26065 The "wow, damn easy" moment

Posted by everfreecreative on 29 January 2013 - 05:19 PM

I have had several similar responses from our clients when I do the final CMS training with them. Sometimes I will also demo it during a pitch. The drag-and-drop file upload always gets a positive reaction :)  And once I have auto image resizing implemented, the admin bar installed, and the manage pages turned off for the client, it couldn't be much simpler!




#23168 Cannot edit roles

Posted by everfreecreative on 28 December 2012 - 10:33 AM

Thank you Ryan!! That fixed the issue. I didn't even realize I could get to the user roles through the page tree. Pretty cool stuff.

While I was doing some more work on the site I had another (hopefully much quicker) question: How do I set the default child page template for a given page and/or template? I seem to remember this being a feature that I used in the past but now I can't seem to locate it. I do love the ability to restrict the type of child pages from the template, however. Great feature!


#18177 Installation problem

Posted by everfreecreative on 09 October 2012 - 09:05 AM

I had the same problem on my local server while using MAMP on a Mac. I was able to solve it by adding the following to my VirtualHost declaration in httpd-vhosts.conf:


<VirtualHost *:80>
   DocumentRoot "/Users/username/Test Site"
   ServerName testsite.loc
   <Directory "/Users/username/Test Site">
      AllowOverride All
   </Directory>

</VirtualHost>


#14216 Getting current template name - Adminbar bug?

Posted by everfreecreative on 30 July 2012 - 06:56 PM

Whoops, nevermind. It's including both classes now. This must have been an error on my part somehow.

Thanks!


#10317 Our first ProcessWire Site (responsive)

Posted by everfreecreative on 09 April 2012 - 09:27 AM

My company has just launched our first site for a client built on ProcessWire. It was an absolute pleasure working with ProcessWire and we look forward to building many more sites on it. The drag-and-drop image uploading, combined with the built-in PW resizing functions is brilliant for clients who need to easily add photos.

As a designer, PW does an awesome job of staying out of the way when it should. I love that I can pretty much build a site exactly as I normally would and then integrate PW on top of that. Because PW doesn't output any markup, building this site responsively was a breeze. Woot!

So, without further ado...

http://www.ctporcelainpainting.com


#8852 Repository of php Scripts for Templates

Posted by everfreecreative on 03 March 2012 - 10:51 AM

Agreed on this. It would be extremely helpful. Maybe in the form of a wiki where everyone could contribute?


I was thinking it would be good if it was something people could contribute to fairly easily. I'm sure that a lot of ProcessWire users here have accomplished a lot of really cool things inside of their templates using the API, and if there were a central place that they could then submit those for the benefit of others, that would save people having to re-invent the wheel or ask on the forums. Which leaves more time for Ryan and others to work on the core and various modules :)

Some kind of basic gatekeeping/moderation would probably be necessary to ensure a minimum quality standard for the scripts.


#8812 Repository of php Scripts for Templates

Posted by everfreecreative on 02 March 2012 - 04:07 PM

Not sure if this has already been suggested, but for the less php literate among us it would be great to have some sort of repository of php scripts on the PW website for formatting template data, i.e. the php snippets for outputting different kinds of menus, breadcrumbs, bloglists, etc.

Similar to a database or list of modules, but specifically for the templating side of things, where you don't require a full-on module. Right now you have to scour the forums (or write your own code) if you're looking to do something beyond the basics that are included in the default templates.