AnotherAndrew
Members-
Posts
168 -
Joined
-
Last visited
-
Days Won
1
Everything posted by AnotherAndrew
-
Unique Private Photo Gallery With User Login
AnotherAndrew replied to NooseLadder's topic in Getting Started
onjegolders, I have created a login and members section based on your code that you detailed earlier. In my page structure, I have something like this: about members --bob --andrew contact The members page is basically a placeholder. When bob logs in he goes to www.example.com/members/bob/. The members page shows up in the menu as www.example.com/members/. What would I need to do to make the menu link for members point to www.example.com/members/bob/ when bob is logged in? And to www.example.com/members/andrew/ when andrew is logged in? -
Thanks diogo. How do you output a list of these pages? My field is named "artworkpageselect". EDIT: I figured it out. EDIT2: How would you specify just 'category1' and 'category2' in the pages field module? It appears that you can just choose one parent. Is there a way to choose more than one parent?
-
I have a situation where I need a client to be able to select from a pre-existing group of pages to include in a member's page of a site. For example, consider this structure: home category 1 --cat 1 content 1 --cat 1 content 2 category 2 --cat2 content 1 --cat2 content 2 members --bob --andrew So would it be possible for a client to choose on the page "bob" to show the page "--cat 1 content 1" and any other page in that category and possibly also "--cat 2 content 1"? The member's pages are hidden from the public and require a login to view "bob" and "andrew". Meaning only user "bob" can login to "bob". Would this be possible by using the "pages" field?
-
Did you add in your declarations for the I element in the styles.js? Also in your PW settings above you need to include "styles" somewhere. Where depends on where you want it to be appear on the editor toolbar. And for the styling formatting to appear you need to also include the css formatting relevant to the I tag in the contents.css file.
-
See my post here. This will explain how to do that. Its a little cumbersome but possible.
-
Detect first and last sibling page
AnotherAndrew replied to AnotherAndrew's topic in General Support
Diogo. Thanks for pointing me in the right direction. I think I will try a little bit of both. Adding a class and canceling the link! -
Detect first and last sibling page
AnotherAndrew replied to AnotherAndrew's topic in General Support
Thanks Diogo. Your code doesn't return the first and last classes as is. Would it not be something like this <?php echo $page->prev ? 'first' : 'previous'?> -
My site structure is something like this: parent item 1 --sibling --sibling --sibling --sibling parent item 2 parent item 3 Within parent item 1, I have a menu that navigates to each sibling page like this: <nav> <ul id="pages"> <li><a class="previous" href="<?php echo $page->prev->path; ?>">prev</a></li> <li><a class="next" href="<?php echo $page->next->path; ?>">next</a></li> </ul> </nav> What I would like to do is change my li class when ever a user would get to the first and last sibling page. Does anyone know how I can do that?
-
confused - is PW more complicated than I need?
AnotherAndrew replied to fredthered83's topic in Getting Started
Fred, think of it as this way. Each project can be located in a "page" under "portfolio". In the page you can set up fields that have an image, description, date, whatever else you want. You can make a template that allows these fields under the portfolio section. That way whenever your client enters a new page under portfolio they just get those fields to enter in info. Above the portfolio section you can have different templates that decide what goes on in the other section of the site. For example you can have a different template for news or contact or etc. Pretty easy to do. Give us some more info on what you need and we can help! -
Repository of php Scripts for Templates
AnotherAndrew replied to thetuningspoon's topic in Wishlist & Roadmap
Following the thread here, it is hard to say that what PW solution you got to work on your site would help others. Every problem or site design is going to be different. And every developer is going to tackle that solution differently. That being said it could be helpful to have such a repository for those new to PW and need some helpful steps to create a menu, image slideshow, members section or whatever else is pretty standard in sites these days. I welcome the idea. -
Ryan, yes I figured that out. But modifying the content.css file just updates the styling of the editor field. It is helpful for a user to understand what it would look like on the site design. I wish just modifying the content.css file would also modify the ckeeditor styles sheet. : ( It's kinda a pain to modify the ckeeditor style sheet. But maybe I'm just been a bit lazy.
-
Answer, solved. Basically, I was not following the correct ids for the calls in the search template. Here's my updated code for anyone who is interested. This will give you a form field that in my case looks like my navigation, but when you click on "search", the text search is removed and an input field appears. <form id='searchform' action='<?php echo $config->urls->root?>search/' method='get'> <input type='hidden' name='q' id='search_querys' value="<?php echo htmlentities($input->whitelist('q'), ENT_QUOTES); ?>"/> <input name='q' id='search_query' name="searchterm" type="text" value="Search" /> </form> And the jquery: $('#search_query').focus( function(){ if ( $(this).val() == 'Search' ){ $(this).val('') }; $(this).addClass('searchinputfocused'); }); $('#search_query').blur( function(){ if ( $(this).val() == '' ){ $(this).val('Search') }; $(this).removeClass('searchinputfocused'); }); $("#search_querys") .val("Search...") .css("color", "#ccc") .focus(function(){ $(this).css("color", "black"); if ($(this).val() == "Search...") { $(this).val(""); } }) .blur(function(){ $(this).css("color", "#ccc"); if ($(this).val() == "") { $(this).val("Search..."); } }); var regEx = /(\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*)/; And the css which is obviously specific to my site design but the functionality might help others: #searchform input {display: block; position: relative; top: -4px; font-family: 'Roboto', Arial, sans-serif; font-size: 16px; letter-spacing: 1px; font-weight: 900; text-transform:uppercase; border: none; color: #39683a; width: 155px;} @-moz-document url-prefix() {#searchform input {top: -2px;}} #searchform input:focus, .searchinputfocused { text-transform: none; text-align: left; font-family: 'Roboto', Arial, sans-serif; font-size: 15px; font-weight: 400; text-transform:none; border: none; color: #2b2b2b; border: none; letter-spacing: 0px; padding: 2px; outline: #39683a solid thin; } #searchform #searchsubmit {display: none; font-family: 'Roboto', Arial, sans-serif; font-size: 16px; letter-spacing: 1px; font-weight: 900; text-transform:uppercase; } #searchform #searchsubmit:active, #searchform #searchsubmit:hover, #searchform #searchsubmit:focus { outline: none; cursor:pointer; font-family: 'Roboto', Arial, sans-serif; font-size: 16px; letter-spacing: 0px; font-weight: 500; }
-
Here's how to add your own styles in case someone is wondering. Before doing so, you need to add it into your text field under input, cke editor settings, cke toolbar, and add "Styles". Then you can modify styles.js under "inputfieldCKEditor/ckeditor-4.1.0/styles.js". Pretty cool. You can add block styling and inline styling. Though the block styling could cause problems with site layout and look if you are not careful.
-
> Have you also modified the template where the search results are listed? No I have modified anything in the template. Do I need to do so in order to match the query?
-
I'm trying to implement a different version of the search form for my site. The original and functioning code for the search form is this: <form id='search_form' action='<?php echo $config->urls->root?>search/' method='get'> <input type='text' name='q' id='search_query' value='<?php echo htmlentities($input->whitelist('q'), ENT_QUOTES); ?>'/> <button type='submit' id='search_submit'>Search</button> </form> I want to have an input field to be "hidden" and when clicked on "search" then the input field is revealed and upon return the search query is submitted. So I implemented this code to do that: <form id='searchform' action='<?php echo $config->urls->root?>search/' method='get'> <input type='hidden' name='q' id='search_query' value="<?php echo htmlentities($input->whitelist('q'), ENT_QUOTES); ?>"/> <input id="searchterm" name="searchterm" type="text" value="Search" /> </form> And my jquery is: $('#searchterm').focus( function(){ if ( $(this).val() == 'Search' ){ $(this).val('') }; $(this).addClass('searchinputfocused'); }); $('#searchterm').blur( function(){ if ( $(this).val() == '' ){ $(this).val('Search') }; $(this).removeClass('searchinputfocused'); }); However, when I submit a query, it does not return a valid search and nothing is revealed. Does anyone know why not and how I can fix this?
-
And I have figured it out. From reviewing this thread where I originally got the code from Ryan, I realized that I was not supposed to be declaring a variable at the top. It needs to be $error = ''; And I inadvertently seemed to have deleted the call to the variable here: $page->body .= <<< _OUT $error <form action="./" method="post" id="contact-form"> Also, I couldn't see my problem locally since I'm using mamp and mamp has some issues with sending mail. Thanks everyone for taking a peek. Its been a long day!
-
Soma, well nothing is working. Mail is not being sent and error messages are not displaying. Also I'm not getting any site errors with debug turned on.
-
I just realized that my contact form is not working since updating to the latest version of PW. I gleaned the following code from the PW forums over a year ago. But I am a noob to php and can't seem to find what could be wrong with the code. Does anyone see anything obvious? <?php $sent = false; $error = 'user@example.com'; $emailTo = 'user.bill@example.com'; // or pull from PW page field // sanitize form values or create empty $form = array( 'fullname' => $sanitizer->text($input->post->fullname), 'email' => $sanitizer->email($input->post->email), 'comments' => $sanitizer->textarea($input->post->comments), ); // check if the form was submitted if($input->post->submit) { // determine if any fields were ommitted or didn't validate foreach($form as $key => $value) { if(empty($value)) $error = "<p class='error'>Please check that you have completed all fields.</p>"; } // if no errors, email the form results if(!$error) { $msg = "Full name: $form[fullname]\n" . "Email: $form[email]\n" . "Comments: $form[comments]"; mail($emailTo, "Website contact form submission", "$form[comments]", "From: $form[email]"); // populate body with success message, or pull it from another PW field $page->body = "<div id='message-success'><p>Thanks, your message has been sent.</p></div>"; $sent = true; } } if(!$sent) { // sanitize values for placement in markup foreach($form as $key => $value) { $form[$key] = htmlentities($value, ENT_QUOTES, "UTF-8"); } // append form to body copy $page->body .= <<< _OUT <form action="./" method="post" id="contact-form"> <fieldset> <legend>Send a note</legend> <ol> <li class="form-row"> <span class="error" style="display: none;" ></span> </li> <li class="form-row"> <label for="fullname">Name</label> <input id="fullname" name="fullname" type="text" size="30" class="name required default" title="Your name" value="$form[fullname]"/> </li> <li class="form-row"> <label for="email">Email</label> <input id="inputemail" name="email" type="text" size="30" class="required email default" title="Your email address" value="$form[email]" /> </li> <li class="form-row"> <label for="comments">Message</label> <textarea name='comments' rows='5' cols='45' id='comments' title="Your message">$form[comments]</textarea> </li> <li class="form-row"> <input type="submit" name="submit" value="Send" class="submit-button"/> </li> </ol> </fieldset> </form> _OUT; } ?><?php /** * Contact form template * */ include("./header.inc"); ?> <div class="main-container"> <div class="main wrapper clearfix"> <article> <section> <?php echo $page->body; ?> </section> </article> </div> <!-- #main --> </div> <!-- #main-container --> <? include("./footer.inc");
-
Get first image and title of children pages
AnotherAndrew replied to AnotherAndrew's topic in General Support
Oh, ok. Now I see the difference! Thanks. And if I want to display the page title I do this: echo "<li><a href='{$selectedthumbs->url}'><img src='{$thumb->url}' alt='{$firstimage->description}'>{$selectedthumbs->title}</a></li>";- 16 replies
-
- first image
- children
-
(and 1 more)
Tagged with:
-
Get first image and title of children pages
AnotherAndrew replied to AnotherAndrew's topic in General Support
Owzim, I tried this but I am still getting full size images. I'm not using the thumbnail module. <?php if ($page->children) { foreach($page->children as $selectedthumbs) { $firstimage = $selectedthumbs->selectedimages->first(); $firstimage->size(100, 100); echo "<a href='{$selectedthumbs->url}'><img src='{$firstimage->url}' alt='{$firstimage->description}'></a>"; }} ?>- 16 replies
-
- first image
- children
-
(and 1 more)
Tagged with:
-
I am trying to output a list of link to children pages that display the child's title and the first image on the child page. I am doing that ok but I do not know how to return a thumbnail size image rather than full size. My image field is called "selectedimages". This is what I have: <?php if ($page->children) { foreach($page->children as $selectedthumbs) { $firstimage = $selectedthumbs->selectedimages->first(); echo "<a href='{$selectedthumbs->url}'><img src='{$firstimage->url}' alt='{$firstimage->description}'></a>"; }} ?>
- 16 replies
-
- first image
- children
-
(and 1 more)
Tagged with:
-
Thanks Marty. That gives me exactly what I needed! Just cleaning up your code a bit for anyone else who is wondering: <body class="<?php echo $page->rootParent->name;?>">
-
Thanks for this great module. It has been really helpful! Is there a way to set a unique body class on parent pages? For example if I have this set up: Home About - Our great team - Why we are great Work - Photography - Design - ETC Contact How would I set a unique class for "home, about, work, contact"? And the child pages would get the same class as the parent page. For example "our great team" and "why we are great" would get the same unique class of "about".
-
Matthew, I have never used shopify and I must agree that it looks like a great product for easy to implement ecommerce sites. I don't know of any sites that are using both shopify and PW but I think that PW can provide a custom ecommerce site if done properly. Have you looked into using Stripe for a payment solution? I have used their services with great results when it comes to payment methods. The service utilizes javascript which can obviously be used in any form that you create with PW. On one site that I built with PW, I created a payment form using Stripe's services and it was rather easy to implement. Let me know if you need any further help.
-
I agree with diogo and onjegolders. Just set it to a small amount less. There might be a padding or margin that is conflicting.