Jump to content

Goca

Members
  • Posts

    8
  • Joined

  • Last visited

Goca's Achievements

Newbie

Newbie (2/6)

14

Reputation

  1. Thank you @Robin S ! That worked perfectly. I completely forgot about Output Formatting. Still getting the hang of the ropes in ProcessWire. 🙂
  2. Hi there, I am creating a system where there is a sort of "template" page that contains details about a particular quiz, and then a user account gets a record page created and associated with their account that contains specific details about their particular progress for that quiz, their status for that quiz, etc. I have the following code in a module to create this copy page: $quizPage = $this->pages->get("template=quiz, id=$quizID"); $record = new Page(); $record->template = $this->templates->get('quiz-record'); $record->parent = $parentPage; $record->title = $quizPage->title; $record->name = $quizPage->name; $record->linked_quiz = $quizPage->id; $record->owner = $userid; $record->save(); (Omitted unnecessary quiz details for this issue) Where $quizPage is the template page containing quiz details (questions, etc.), and $parentPage is the container page to hold all of a particular user's records. When I try to set the title of the new page using $quizPage->title as the value, if the source page has a single quote in it, for instance... if the title was People's Choice, the new page has the HTML Entity entered as the page title, so the title becomes People's Choice for the new page. I've tried outputting the raw title to see if it's stored as an HTML entity, and even checked the database value directly, but it definitely is just a single quote. Is there any way to get the new page's title to contain a Single Quote rather than the entity value? Thanks!
  3. Thank you both for the replies! Little by little I'm learning which areas of ProcessWire are okay to customize, and figured it was best to check. 🙂
  4. Hi there! I tried to look through the forums, but couldn't find what I was looking for, and just had a quick question. I'm building a site that tracks a user's progress through material, as well as attaching different meta data to a user. Is it safe to add fields to the User system template, such as first-name, last-name, current-module, etc.? I wouldn't remove any of the standard fields that are a part of the User template. I guess it's also worth asking, would the LoginRegisterPro module be best to use for something like this? Thanks!
  5. Thank you all for the insight! This has been super helpful. This community continues to impress me with how helpful and kind everyone is. The more I learn about ProcessWire the more I like what I see! This gives me the direction I need to continue development. I appreciate it!
  6. Hi all! I'm currently building a school quiz system in our site, and with back and forth interlinking, I'm finding that the Title field is not necessarily needed for some pages. The short of the design is... The school is split into 5 modules Each module has X number of quizzes Each quiz has X number of questions The only way I've thought to do this, with what little I know about ProcessWire so far, is entirely through the use of pages. So here is my current page structure: Home -- School -- Module 1 -- Quiz 1 -- Question 1 -- Question 2 -- Quiz X... -- Question X... -- Module X... And so on. The thing is, for questions, all I need is the Question Content, and some other minor metadata. There's no real "Title" to the question, as the question content itself is kinda both the content and title. Technically if the question is short enough, I could use the Title field for this joint purpose, but I can't guarantee the question won't exceed the 255 character format, plus the Title field feels like the wrong place for this data. There's a more pertinent area where I don't need the title though, and that's in the other area of the site for Student Records: Home -- School ... -- Student Records -- John Doe -- Module Record 1 (Relevant data being stored for a particular module as a whole) -- Quiz Response 1 (This record contains the student's answers for a particular quiz) -- Answer 1 (This record is a simple back and forth conversation between students and teachers) -- Response 1 (Response from a teacher if answer is incorrect) -- Answer 2 -- Response 2 -- Etc... -- Quiz Response X... -- Module Record X... -- Jane Doe ... The main area of design that I'm not entirely sure of yet (because I'm still learning ProcessWire) is if I would be better off just using a repeater field for the Answer / Response records, and just making that a field for a Quiz Response instead of sub-pages, but I'm not certain how searchable Repeater data is, and the ability for teachers to very granularly search student / quiz data is important. The basic linking of data is: Modules are are defined within the "School" section of the site, Quizzes are assigned to a module as sub-pages, and Questions are assigned to a quiz as sub-pages. Student Records are created for each student upon sign up with relevant data attached as fields (Name, Age, Email, other metadata, because I couldn't find a way to link fields to users instead of pages). Module records are assigned as sub-pages and contain data such as Module Progress, Current Quiz, etc. so teachers can track that data. Quiz Responses are assigned as sub-pages of Module Records, and linked to the relevant quiz by a Page Reference (mainly so that we can also view all answers for a particular quiz regardless of specified student). The answers / responses are then entered either as sub-pages, or repeater fields. A lot of these pages do not particularly need their own titles because they can inherit titles from their linked pages with their Page Reference fields, however, I don't know how ProcessWire wants to handle all of this. Maybe the title is always required and should never be removed, and is okay to duplicate between pages even if it is always going to be the same (as in the instance of a Quiz, and a Quiz Response), but then I would also need to write routines so that if a Quiz title is ever updated, every Quiz Response title is also updated to match, which seems tedious when I can just link the 2 together and grab the Quiz title. Or perhaps I'm going about this the wrong way, and I'd be better off using custom database tables? From everything I'm seeing, it seems like Pages can entirely be used for this purpose, even if 80% of them don't have template files because I will be aggregating and displaying the data via "Search" and "Dashboard" pages. So I guess the overall question that I have is, if I disable the checkbox requiring Title on all pages, so that I can create some pages that don't have titles, is that dangerous? Looking forward to any insight you all may have! 🙂
  7. Thank you all for your answers and insight! The more I look at ProcessWire the more I like what I see, and I appreciate you all clearing up my question for me. I'm looking forward to continue experimenting with this system, but honestly one of the biggest things I love about this so far is the community. Good documentation and ability to get questions answered is a big deal for me. So far I love how extensive ProcessWire's documentation is, and I thank you all for the warm welcomes!
  8. Hi there! I'm very new to ProcessWire, just found the system about a month ago and have been toying around with it a bit, and I'm loving everything I'm seeing! I'm coming over from the Concrete5 CMS, which I've been working with for 10 years, and one of the primary things that's so alluring to me about this CMS / Framework is that it doesn't try to get in your way. It seems like it's very much built with the mentality of providing the tools to build what you need, rather than forcing you to work around systems built for a specific purpose, and along with that, it seems like the community is incredibly helpful and friendly, which is always a big plus! One of the concepts that I'm used to from Concrete5 is the concept of Single Pages - one-off pages that are made for a specific purpose, and all of its code is self-contained, rather than part of a reusable templates. I am currently building a system that somewhat resembles an LMS - essentially needing Students, Student Records, quizzes / tests, and answers to them for each student record. The perfect example for my case is a user dashboard, to be able to view current tasks, know where to go next, etc. which won't be re-used anywhere else except on one page. From what I'm seeing with ProcessWire, it seems the base concept is that if you want a page to display on the front end of the site, it needs a .php template in the /site/templates/ directory, and even if the template is used in multiple pages, or only one, it makes no difference, and this is where it would / should go. Am I correct in this thinking? I want to make sure that as I learn ProcessWire, I get used to the standards and best practices that people have come up with, and I'm sure there's an answer to this somewhere already that I possibly overlooked, but I wasn't able to find it. Any insight on this would be much appreciated! Thanks!
×
×
  • Create New...