-
Posts
121 -
Joined
-
Last visited
Everything posted by hollyvalero
-
*** Thank you. The more I played with it the more I thought, "you know... this is for search results...I don't think this is the right application for the pager... so I went on to do the next and previous page thing - less terrific than yours so I will be happy to try your code as mine is a little thin. But thank you for that. Suspicions confirmed. ?
-
Trying to create a report environment for a nonprofit with a lot of lengthy guides. 3 Templates: report cover, report TOC, report pages. Cover will be simple http://test.hollycodes.com/a-short-history-of-flatbreads/ TOC is a list in manual order of all pages http://test.hollycodes.com/a-short-history-of-flatbreads/table-of-contents/ Report page is the actual report content. These are the pages where I want pagination at the bottom in some format: Previous 1 2 3 4 5 Next Page numbers are turned on for the Report page template (not TOC or Cover - do they need to be on for the parent pages?) I am trying this for pagination: - - - - - - - $options = array( 'numPageLinks' => 10, 'listClass' => 'uk-pagination', 'linkMarkup' => "<a href='{url}'>{out}</a>", 'currentItemClass' => 'uk-active uk-text-bold', 'separatorItemLabel' => '<span>…</span>', 'separatorItemClass' => 'uk-disabled', 'currentLinkMarkup' => '<span>{out}</span>', 'nextItemLabel' => 'Next', 'previousItemLabel' => 'Previous', 'nextItemClass' => '', 'previousItemClass' => '', 'lastItemClass' => '', ); $items = $page->parent->children("limit=2"); $pager = $modules->get('MarkupPagerNav'); echo $pager->render($items, $options); - - - - - - - This is giving me the active page bold, the numbers, next & previous... but all the links are relative to the current page - whichever one you are on: http://test.hollycodes.com/a-short-history-of-flatbreads/table-of-contents/neanderthal-flatbreads/page2/ http://test.hollycodes.com/a-short-history-of-flatbreads/table-of-contents/neanderthal-flatbreads/page3/ Instead of going to the actual pages http://test.hollycodes.com/a-short-history-of-flatbreads/table-of-contents/neanderthal-flatbreads/ http://test.hollycodes.com/a-short-history-of-flatbreads/table-of-contents/indian-subcontinent/ http://test.hollycodes.com/a-short-history-of-flatbreads/table-of-contents/what-makes-flatbread-flat/ Been trying to suss out what I am doing wrong for a few hours and not seeing it...
-
-- Thanks again for your help! I was able to get it working and get all the data imported after a little tinkering. Also, that server lag? It's a perpetual slow spot outside of chicago that I seem to run into using traceroute, so I don't think it's Batch Child Editor...
-
Thanks for your good eyes. I'll go line by line first thing tomorrow...
-
-
-
So this code: $subjects = $pages->find("template=subject, limit=100, sort=title"); foreach($subjects as $subject) { echo "<option value='".$sanitizer->alpha($subject->title, Sanitizer::translate)."'>{$subject->title}</option>"; } Does product the single name dropdown, lower case without the & or spaces. <option value='artandculture'>Art and Culture</option> <option value='mapsampgeo'>Maps & Geo</option> <option value='Science'>Science</option> I thought it was working, but realized I need to include a leading PERIOD in the option value before the name in order for mixitup to work... : <option value='.mapsampgeo'>Maps & Geo</option> <option value='.artandculture'>Art and Culture</option> Is there a way using this sanitize string to add the "." back in or do I need to go back to 2-3 steps to launder stuff out?
-
The sample page name is my working "worst case scenario" but there's no way of guessing what page titles will be. I've got multiple versions of this foreach loop... $submix = $subject->title; (maps & geolocation, math, STEM, and a zillion others) $resmix = $resourcetype->title; (videos, games, magazines, etc.) $audmix = $audience->title; (kids, taxpayers, college bound, whatever) Assuming I might have to convert each title variable back to HTML, then remove "&" or all special characters... Then spaces... and dashes I think caps and lowercase will work fine, however.
-
Hi! I've got 3 page reference fields (multipage) used to tag database entries by audience, subject area, and resource type. These can be created on the fly, so you can ideally curate a special collection and have processwire generate pages, sorted displays, etc. Using Mixitup to create a nice sift and sort with multiple drop down menus. Mixitup doesn't like spaces, dashes, special characters - just letters. Rather than tell everyone, "don't use special characters!" I'd like to assume the worst and strip them out behind the scenes. The option value and card class are both invisible, so as long as it's just letters it should work whether it's upper or lower case. For the drop down menu I need to generate something like this: <option value='.ResumesJobs'>Résumés & Jobs</option> And then the actual card display below will contain a matching ID: <div class="mix ResumesJobs"> ---etc. </div> I've got the basics working... I can remove extra spaces. I can get rid of special characters. But I keep getting dashes and amp; in the displays. Tried the sanitizer->pageName which didn't get rid of the amp. Sample of my sad code below... gather all pages listed under subjects... create a variable $submix for the title... then try to strip out spaces and characters: foreach($subjects as $subject) { $submix = $subject->title; $submix = str_replace(' ', '', $submix); preg_replace('/[^A-Za-z0-9\-]/', '', $submix); echo "<option value='.$submix'>{$subject->title}</option>" ; } Is there a better single process? Sanitizer seems like overkill since this in internal stuff, not user input. Tried to html encode & back to & and then strip spaces, characters, etc. but bogging down in errors and unable to get rid of dashes. Would appreciate any insights.
-
Hi, I'm coding a pile of research that ends up being tagged for a variety of issue areas: early childhood, human rights, justice, etc. Using a multiple page array field to make it easy to select an unlimited number of issues. In most cases I want to spit out that whole list when the research blocks come up with titles, links, images, etc. so people can click any issue area listed... like this... foreach($feature->issue as $item) { echo "<li class='iss uk-text-tiny bold caps'><a href='$item->url'>$item->title</a></li>"; } But for the home page, I'd like to restrict the listing of issues to just the first one in the list, as that will be the primary issue area... rather than create a separate field. The total count doesn't matter because I want to use just the first and ignore the rest... foreach($feature->issue as $item) { [select the first issue in the list of supplied issues and then spit that one out linked] echo "<p class='iss uk-text-tiny bold caps'><a href='$item->url'>$item->title</a></p>"; } I'm getting better and bringing back everything but don't know if I should try to put in a counter? Establish a limit? ... appreciate any help.
-
Oh, that is Nifty!!
-
I like the Reno wrapper for the admin. After looking at UIKit, then switching back to Reno, the back end is all Reno but the basic back end login page /processwire or /whateveryoucallit is displaying the original Default instead of the Reno login. I realize this is a first world problem, but I can't seem to reinstate the Reno login. Tried installing/uninstalling... It's not the same page code and it's not the same style sheets... I can't uninstall the default ...what am I doing wrong?
-
Relative vs Root link paths - How to update after a DNS change
hollyvalero replied to hollyvalero's topic in General Support
Yeah, I think you're right. Just need to mimic the final destination... domain or subdomain for those that will be at the root. Or, identical folder name for those that will be in a subdirectory.- 5 replies
-
- internal links
- dns
-
(and 1 more)
Tagged with:
-
Relative vs Root link paths - How to update after a DNS change
hollyvalero replied to hollyvalero's topic in General Support
^^ btw, I did come up with an idea that would work... for websites that are either redesigns or brand new, I've designated an unused domain, activated it, and that will allow me to build at a .com address, export the site profile, and import it to another root level address. An addition to export site profile would be ideal, but this will work in the meantime...- 5 replies
-
- internal links
- dns
-
(and 1 more)
Tagged with:
-
Relative vs Root link paths - How to update after a DNS change
hollyvalero replied to hollyvalero's topic in General Support
Yeah, trying to avoid further obfuscating DNS stuff, since that's the kind of thing that inevitably falls through the cracks later... no one remembers... the site grows big... It's not a huge site and grepping out all the paths will not take more than maybe an hour or two... I think. I'd rather do it now, before it gets bigger... Just wondered if there was a way to establish the root path within processwire. This is also helpful for developing a new site at an existing server... you'd want to build in a separate directory and move it up one while the current site is live and uncompromised. It's an administrative detail that always pops up in redesign. It would be the kind of thing that -- if it was part of Export Site Profile? Well, that would take care of it... if you could say "reset root path to..." with a domain name or domain.com/directory/path ...- 5 replies
-
- internal links
- dns
-
(and 1 more)
Tagged with:
-
I have a website on a shared server that I use to store a few sites. My active domain is at the top. The new website domain hasn't been activated yet, but the path would be something like: myactivedomain.com/newdomain.com/ and once the DNS is flipped, just newdomain.com/ As I am building and adding a load of PDFs, all the links default to /newdomain.com/site/assets/files/etc... This isn't migration, but a DNS activation. Once that is updated, I'm still going to have a bunch of /newdomain.com/ links in there to pages, pdfs, images, etc. Before I resign myself to grepping out page-by-page all the "/newdomain.com/" references I thought I would see if there's a way to update these automatically in processwire but I'm seeing stuff on migration... stuff in the rich editors about correcting links, but I don't see anything that covers this. Is there a way to do this automatically? Via module? I didn't see anything in the config file... but would be grateful to anyone who can shed some light...
- 5 replies
-
- internal links
- dns
-
(and 1 more)
Tagged with:
-
Possible to register and login simultaneously
hollyvalero replied to onjegolders's topic in General Support
I'm don't know how to implement this. Does every input field in the form need to be replace with a $variable . So the username field: <label class='label' for='username'>Username</label> <p class='control'> <span class='help is-info'>Please ensure your username contains <b>no spaces</b>. </span> <input type='text' class='input' name='username' value='{$v}'> </p> Does the entities string go before or after the form entry above? Do I batch all the sanitizer entries first? $v = $sanitizer->entities($input->post->first_name); Further down I am creating a user. Does this: $u->name = $sanitizer->username($input->post->username); Need to be changed to: $u->name = $sanitizer->username($v); If I can figure out the order for one field, I can apply it to all of them. -
Module FrontendUser: login, logout and register users / members
hollyvalero replied to pwFoo's topic in Modules/Plugins
Yeah, I could probably do that... I'm going to install Front End User at another copy of PW... see how that looks. Save this for my plan B. Thanks!