list template help

Hi Kevin, I'm trying to setup a list template. I like the look of the default listing, but I need it to say the title of the form rather than than "Submission to "paddlespots"" I did setup a html form, but I can't get the same styling. and when you click on a result you are brought to another page with just that one listing on it with no way of getting to the form itself. Is there any way I can just change the default_form_data_listing.php? I don't know what code I would need to have it pull the form title. 

  • There should be nothing in default_form_data_listing that cannot be done with a custom list template. There is detailed documentation for this is in the form README.txt.

    Are you saying that there is no way to access the form title and that this needs to be made available in a special variable such as $_form_title? If I've overlooked that, I can easily add that.

    You can patch that yourself by adding

    $vars['_form_title'] = $form->title;

    after line 1066

    of mod/form/models/model.php

    If you see any other stuff that should be in there, please tell me and I'll add it for the next release.

  • Actually, this should be

    $vars['_form_title'] = form_form_t($form,'title');

    to make sure that multiple translations for the form are supported.

  • Kevin, thanks for your reply. I figured out what my issue was. I had used the tags field as the form title. So when you clicked the form title in the search listing, it brought you to the related tags results. And since I didn't have a "full view" link, I couldn't view the form. After reading the README again, and realizing I was missing the curly brackets on some of my php. I have been able to get it closer to what I was looking for. 

    image

    This however did bring me to a couple other things, and this could be my lack of experience. Instead of "full view", is there a way to make the title the link to the form? I couldn't figure out how to use friendlytime with the template. And, the last thing. On my resulting form page, would there be a way to show "Website: Click Here" rather than displaying the full url? It pushes my map off the page if the url is too long. Inline parameter?

    Thanks again for the great plugin.

    Skot

  • Hi Kevin, I was wondering if you had any answer to the above questions?

    Thanks

  • Take a look at the code in model.php I mentioned above. If there is something missing from the template variables, you can always just add it there.

    Please tell me what you added and I will look into adding it to a future release.

  • Thanks for the reply Kevin,

    But this doesn't help me much. I said in my post "my lack of experience". I've just started learning php in the last month or so. I'll figure it out or just hire someone to do it.  I understand your busy working for clients.

     

  • An update:

    I've added $_friendlytime to the next form plugin release (out today). So far as I know, you can do everything else with the existing code. Eg. $_full_view_url gives you a url to the content (which you can wrap in html).

    Edit: fixed error in brackets.

  • Kevin, there's one problem. I don't know if this is a bug, or a feature, but when I try to put a following HTML into a form:

    <a href="{$_full_view_url}"> </a>

    I get:

    <a href="actions/form/{$_full_view_url}"> </a>

     

    Is there some nice workaround for this? Right now I have to change the textbox content in Firebug to get the url I want.

  • vazco: Those special fields are only for list and display templates.  You can't enter HTML directly into TinyMCE  when editing those templates either (it will escape it).

    You need to turn TinyMCE off or use the TinyMCE HTML window.

Form and related plugins

Form and related plugins

User-generated content, flexible user and group profiles, registration forms, custom file forms