Jump to content

DarsVaeda

Members
  • Posts

    46
  • Joined

  • Last visited

Everything posted by DarsVaeda

  1. Editors should be able to change the value of the field in the backend so that in the frontend say they can change or translate the label or placeholder of an input field. Hey, the form is just one example where I hit the need to have reusable fields. Another one would be the list mentioned above. I don't want a form builder.
  2. No, that's only a static form and currently the only one.
  3. I think I could add what I came up with so far. You possibly get the idea for the rest of the form: <div class="col-sm-6"> <small>* mandatory</small> <div class="form-group"> <label class="sr-only" for="reason"><?= $page->input_list->get(0)->plaintext ?></label> <select name="reason" class="form-control"> <?php foreach ($page->input_list->get(0)->option_list as $option): ?> <option><?= $option->plaintext ?></option> <?php endforeach; ?> </select> </div> <div class="form-group"> <label for="message"><?= $page->input_list->get(1)->plaintext ?></label> <textarea id="message" class="form-control"></textarea> </div> </div> <div class="col-sm-6"> <div class="form-group"> <label for="message"><?= $page->input_list->get(2)->plaintext ?></label> <div class="radio"> <?php foreach ($page->input_list->get(2)->option_list as $option): ?> <label class="radio-inline"> <input type="radio" name="gender" value="<?= $option->input_value ?>"> <?= $option->plaintext ?> </label> <?php endforeach; ?> </div> </div> <!-- ... --> </div> What would be nice ie. is changing the naming from "$option->plaintext" to "$option->label" but then I could reuse that field only for labels...
  4. Sorry for taking so long but here I made a real life example of a part of a page/template I have to implement. It is a standard contact form and the simplest template I have on the site: https://jsfiddle.net/k2z4v5b5/ I want to be able to edit all texts you can see: labels, placeholders, button text and even options. All those texts are translated into x languages. For the button text and the textarea I can use reusable general fields, for the select group I can use a repeater imo. But for the other input fields...I currently tried with a repeater. That would works somehow if you watch out for the order and all the input fields are of the same type. It gets messy (I think) with the gender radio. Now I have to add two sublabels to the repeater but only one input actually uses it. Now editors have to know that they only have to input it with radio input. Most won't be able to get that. Using non general fields I would at least need 10 fields aka 10 tables So I would really be grateful for input on how you would implement this code: <main id="main" class="wrapper contact" role="main"> <div class="container"> <div class="row"> <article class="col-xs-12 plain_text"> <div class="row"> <h1 class="col-xs-12 title">Title</h1> <div class="col-md-8"> <edit html_textarea>some textarea</edit> <div class="flex-row"> <div class="col-sm-6"> <small>* mandatory</small> <div class="form-group"> <label class="sr-only" for="reason">Label 1</label> <select id="reason" class="form-control"> <option>some option 1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> </select> </div> <div class="form-group"> <label for="message">message *</label> <textarea id="message" class="form-control"></textarea> </div> </div> <div class="col-sm-6"> <div class="form-group"> <label for="message">gender</label> <div class="radio"> <label class="radio-inline"> <input type="radio" name="sex" value="female"> female </label> <label class="radio-inline"> <input type="radio" name="sex" value="male"> male </label> </div> </div> <div class="form-group has-success has-feedback"> <label class="control-label" for="inputSuccess2">name</label> <input type="text" class="form-control" id="inputSuccess2" placeholder="John Doe" aria-describedby="inputSuccess2Status"> <span class="glyphicon glyphicon-ok form-control-feedback" aria-hidden="true"></span> <span id="inputSuccess2Status" class="sr-only">(success)</span> </div> <div class="form-group has-warning has-feedback"> <label class="control-label" for="inputWarning2">mail</label> <input type="text" class="form-control" id="inputWarning2" placeholder="example@email.com" aria-describedby="inputWarning2Status"> <span class="glyphicon glyphicon-warning-sign form-control-feedback" aria-hidden="true"></span> <span id="inputWarning2Status" class="sr-only">(warning)</span> </div> <div class="form-group has-error has-feedback"> <label class="control-label" for="inputError2">something</label> <input type="text" class="form-control" id="inputError2" placeholder="type something dude" aria-describedby="inputError2Status"> <span class="glyphicon glyphicon-remove form-control-feedback" aria-hidden="true"></span> <span id="inputError2Status" class="sr-only">(error)</span> </div> <div class="form-group"> <label class="control-label" for="input">something else</label> <input type="text" class="form-control" id="input" placeholder="we want ur data"> </div> </div> <div class="col-xs-12"> <div class="checkbox"> <label> <input type="checkbox" value=""> Yep please use sell all my data! </label> </div> </div> <button type="button" class="btn btn-primary btn-lg">send</button> </div> </div> </div> </article> </div> </div> </main>
  5. Hmm maybe, I need to try but I only have one user currently who is admin. But now after updating I have the problem that all fields get "deleted" when starting to edit. I'm not sure if it's my implementation or a bug. Need to dig into this.
  6. Why? See for example this footer: I would generate 5 fields so each can hold one of the lists, wouldn't I? PS: Actually this example is a bit bad, as it could be done with a repeater. I can't find any better example now. Just imagine there is content in between so there are only "Category" and "Books" left. If you now use a repeater I don't think people would get what is related.
  7. Hmm can't buy that currently. For example: Currently I'm implementing a form in PW. There are 7 input fields that each have a label. So I would have to make 7 plain text fields for this? Cause I don't think I could use a repeater as no one would know which field is what label.
  8. So there is no extra layer to reuse a field within a template? Any reason to why this is the case or is this on the feature list?
  9. Say I have a field for an unordered list. I need to have such a list twice on the page with different list items. Ideally I would create one field that can take html and only allows for <ul> and <li>. I can add the field to another template. But it seems I can't add that field twice to a template or am I missing something?
  10. Just for reference, programmatically it is fairly easy: <?php $frontpage = $pages->get(1); // 1 is the root page ?> <!DOCTYPE html> <html lang="en"> <head> ... </head> <body> <header> ... <p class="support_hotline"><?= (!empty($page->field_support_hotline) ? $page->field_support_hotline : $frontpage->field_support_hotline) ?></p>
  11. Hi, what is the common way to share content between pages? It would be best if they would be editable from all pages and even further, if I could overwrite the main instance with subinstances aka page specific content. Say I have a header that includes my support number. Now I have this field on the main page to be editable. But of course the header is the same on all pages. So I want to have the same content of that main page field in all pages. But maybe there is a subpage for say a specialized section in my company that has a special number. So that page would overwrite the default value from the main page. I thought I do this with HannaCode but just figured that when creating a new page, these fields need to be filled with the HannaCode. So I guess I could program this into the template referencing the main page and so on but maybe there is a mechanism included to do this.
  12. Hi, how do I enable frontend editing for repeater fields? It partially works with foreach($page->repeater_field as $item) { >? <li><edit list_item><?= $item->list_item ?></edit></li> <?php } But if I click a frontend item the text disappears. I'm not sure if this is a bug or because it does not know which text it should reference. I tried with: foreach($page->repeater_field as $item) { >? <li><edit list_item_repeater<?= $item->id ?>><?= $item->list_item ?></edit></li> <?php } But that results in an exception.
  13. Hey Andreas, that's how I solved it in the end. Thanks a lot!
  14. Hi, I have the following simplified layout on my page: ... row1_card1 - row1_card2 - row1_card3 row2_card1 - row2_card2 - row2_card3 ... You can add as many rows and cards per row as you like. Each card has a title, text and a button whose text is the same on every card but should be editable too, just not individually. I wonder what is the best approach to do this without making it awfully complicated to setup in the admin from an editors perspective. I thought about a solution using a PageTable for the rows and a Repeater for the cards but that started to be complicated to setup even. It would be awesome if you could use the FrontpageEditing to edit these cards and even add more or add rows. How would you implement it?
×
×
  • Create New...