RyanJ
Members-
Posts
208 -
Joined
-
Last visited
Everything posted by RyanJ
-
ah, I did not know that was an option. I apparently overlooked that part ... Doing so diogo will return a 404 if you try to access the link directly?
-
Have you tried using $page->find? I was having some issues using $page->get and switched to $page->find and was able to achieve the results I wanted. I do not completely understand the difference between "get" and "find" though. For an example, I cannot get this to remove the specific page id foreach($pages->get("/")->children()->remove("id!=100") as $location) *Edit, Fix the above and now works fine.
-
Based on the structure below, "employee", "department" and "year" are simply place holder "pages". Each have been assigned a blank template and contain only a title field which is required. They serve no other purpose. The issue I was seeing is that I could access these pages in the url directly. For example, root/location1/employee/ would simply display a blank page. This is undesirable for me as it made me fell empty and marking the page as hidden in the back-end did not resolve the issue. So I saw the option unpublished in the back-end and it works perfectly. I then found Ryan's post here which explains a lot but this example I think deserves its own topic. Would my handling of this be considered advisable or would something else be a better solution, like a 301? I noted that marking a page hidden excludes it from the find() method, but I simply grabbed the children by their templates. Location 1 - Employee -- John Doe --Jane Doe - Department -- Confused Department --Even More Confused -Year -- 2013 -- 2014
-
Hi Pitbull, I am currently working on a search form that has drop downs of categories, input fields and allows you to search a range of values, in my case it is ages. I will be sure to share my code when/if I ever get it completely figured out and working. I am new to pw and have a basic understanding of php, so I am taking Ryan's example from the skyscraper profile and altering it to my needs. Hopefully I can get it complete soon and share as many others do in these forums.
-
Thanks Kongondo, I am guessing I would have to do a foreach within the current foreach?
-
Okay, so I figured it out sorta. I had to change the field type to "Single page (Page) or empty page (NullPage) when none selected" instead of the multiple pages. Also if I tried the single page boolean, I threw this error "Trying to get property of non-object". Maybe someone can educate me today on how this would work or if it could work with the multiple page array?
-
Hello, Im using the following structure Location 1 - Employee -- John Doe --Jane Doe - Department -- Confused Department --Even More Confused Each employee is assigned a department which I am using a select page reference field. I need to be able to print the title of the department. I am using the following to output my fields, but for the "department" field, I can only get it to print the id. I am assuming this is because its only a page reference field as to why it will not print the title. Any tips are appreciated $employees = $page->find("template=profile"); foreach ($employees as $employee) { echo '<tr>'; echo "<td>{$employee->first_name}</td>"; echo "<td>{$employee->last_name}</td>"; echo "<td>{$employee->job_title}</td>"; echo "<td>{$employee->department}</td>"; echo "<td><a href='{$employee->url}'>Profile</a></td>"; echo '</tr>'; I have tried echo "<td>{$employee->department->title}</td>"; with no luck
-
I am seeking some advise on option 2. Simple Multiple Categories for my structure. Basically I have several locations that will list employees. Each location will have different employees. Each employee will have at the minimum a First Name, Last Name, Title, Department, Age, Image, Year. Employee Fields would be: First Name, Last Name, Title, Age and Image which will be unique to each employee. Department: An employee may belong to one department and in rare cases maybe more. A department will have multiple employees, the departments will vary per location. Year: Same as department The most important part that I need to confirm is that on the front end, the user will need to be able to search the employees by first name, last name, department, year and a range of ages IE Low____ High____. Ideally the first name and last name will need be input fields and the rest could be a drop down. Location 1 - Employee -- John Doe --Jane Doe - Department -- Confused Department --Even More Confused -Year -- 2013 -- 2014 Location 2 " " Location 3 " " So my question is am I on the right track and is it possible to create the search functionality that I would need with the above layout? Thanks in advance for any tips, advise, recommendations or silence
-
Would really like to know if any was able to get option 1 here working with hostgator? I have set up everything perfectly, but for some reason it does not want to point the sub-domain. Update! After banging my head for a few days. To "point" a domain in most shared hosting accounts is to "park" a domain. Now that I feel dumber , I hope someone else will find this useful. It works perfectly!
-
Teppo, that is indeed what I am trying to do. Thanks for the easy to understand explanation. I will give it a try. Cheers!
-
Kongondo, thanks very much for taking the time to make this post. It really puts the tree organization into perspective. It also goes the extra mile and walks you through the process of doing it and making it easy on the eyes. Cheers!
-
Hi Ryan, Thanks for the reply. I did think of a new pw install per sub-directory, but thought it would be less maintenance if I had one core. Ideally the project I am working on is one site, but I need a separate database per directory. I looked into the sub-domain and completely overlooked the initial sentence on your instructions of pointing the sub-domain to the main domain. I have not tried it yet, but everyone else has seemed to accomplished it, although I am a little confused on how the url would work if the sub-domain is pointing to the main domain. In regards to the symlink, I am not familiar with them at all, so I will need to look into how to work one up. Thanks for the info and hopefully I will figure out the symlink part. If not I might just go the easy route and do a new pw install per directory. Although I will have a significant amount of directories and could see space being an issue.
-
Hi Diogo, Thanks for the quick response and link. I was still unable to get the subdomain to work properly. I think I will just do a new pw install on my local and export it to the live sub domain db when I am done. Sounds like it might be easier and quicker Thanks again. After looking at the apache error log, it looks like it was looking for the subdomain folder within the wamp/www/ directory. Note sure how to get around that. I had also misunderstood the forwarding of the sub-domain as well and think this is only possible by creating a new dns record. I would be curious if any others have manged to set it up on a local environment. Or I could be completely over my head (which is more likely possible)
-
Is it possible to set up the sub domain multisite on wamp?
-
Thanks diogo, it would be nice to have either option, but I could see how it could cause some problems.
-
I think my post here was better suited for this topic. From all the examples I have seen, you cannot use sub-folders but just different domains and sub domains. Would that be correct?
-
Is it possible for this to work with subfolders instead of sub-domains? Example mainsite.com mainsite.com/site1 mainsite.com/site2 I have followed the steps here, but I am not having any luck getting the subfolders to work.
-
I happened to run across this today and thought I would share. I don't know your level of understanding for basic programming, but I sometimes like to revisit the basics. Although php is not used here, its the same concept. The instructor here makes it very interesting with her enthusiasm, that is actually entertaining. I hope someone just starting out may find it useful. Here is the link
-
I agree, if just using the image, ditch the <h1>. From your first post, I think you were trying to replace the headline text with the logo if I understood correctly.
-
Organization; templates and fields, by category, etc.
RyanJ replied to Grays's topic in Getting Started
The cool thing about the fields is that you can just collapse them in the back-end if they are not used that often. And when you need them, just un-collapse them. -
Try this <?php $image = $page->logo_image->size(287,80); echo "<a href='{$config->urls->root}'><img class='logo' src='{$image->url}' alt='{$image->description}' /></a>"; ?>
-
I think you will find what you are looking for in the main.inc file on line 60. You could try to add something like this to that file. if($page->image) echo "<img src='{$page->image->url}'>"; Check out this for outputting images if you have not already. **Disclaimer, I have not tested it and could be completely wrong. I'm still learning myself, but thought I would give you my 2 cent.
-
Organization; templates and fields, by category, etc.
RyanJ replied to Grays's topic in Getting Started
Hi Grays, I personally would stick with one template and use an if statement to check if it has a value or not. No need for two templates which could later cause confusion. I would create two separate fields for the images. 1 for the body text and image, then 1 for the image gallery. The body field is likely to spit out <p> tags and your <img> within it. (although you can have it spit out whatever you like) The image gallery field, you could spit out a list of images and it would allow you to do all sorts of things with them using jquery or css. Just my opinion though. -
@Grays, do not feel alone. I too am new to ProcessWire and still trying to put things together. Although I have been working with WordPress for a few years now and have spent many hours trying to hack the default ways of it, I still consider myself very green when it comes to php. I have went through each tutorial on here and read them twice. I then just started building in my local environment, I built 4 simple demo sites as reference libraries in 24 hours. I also am trying to just learn the in's and out's of the framework. I am looking forward to working/learning with it and will keep an eye out for your questions as I am sure I will have the similar ones. With that said, my opinion is to just dig in and build.
-
Lightbox gallery launched from single thumbnail?
RyanJ replied to photoman355's topic in General Support
Just so I will know for sure, the ? operator is checking if the left statement is not null correct?- 4 replies
-
- lightbox
- prettyphoto
-
(and 3 more)
Tagged with: