dataform for dummies - is not showing "views"

dataform for dummies - is not showing "views"

autor Willian Teodoro -
Počet odpovědí: 22

Hi! 

I'm trying to use the dataform, but can not seem to.

I created a test field:

-------------------------------------------------------------------------------------

-------------------------------------------------------------------------------------

 

I created a view:






-------------------------------------------------------------------------------------

 

I can not display the form:

 

Many thanks for help! mrknout 

Průměr hodnocení: -
V odpovědi na Willian Teodoro

Re: dataform for dummies - is not showing "views"

autor Itamar Tzadok -

Of all view types in that release you had to choose the one that has a specialized (not particularly stable) intended behavior? překvapení

Please use a normal view such as Tabular or Grid or Aligned. The Editon view is dropped from the new version and its intended functionality is implemented another way.

úsměv

V odpovědi na Itamar Tzadok

Re: dataform for dummies - is not showing "views"

autor Willian Teodoro -

Thank you, Itamar!! 

The new version of Dataform is fantastic, congratulations!

One question: Is it possible to use the "repeated entry" as in the previous version? I need this to create a horizontal table with the records.

Thank you, again! mrknout

V odpovědi na Willian Teodoro

Re: dataform for dummies - is not showing "views"

autor Itamar Tzadok -

Have you tried the aligned view type? It has a simplified entry template for organizing the entries in a  a horizontal table.

The tabular view type (docs incomplete) is another way, where the default entry template is already a table and you can use the editor button to add columns and styles or switch to the html mode of the editor to modify the html directly.

If the aligned and tabular views cannot meet your template requirements and you're looking for something similar to the header and footer sections in the list template of the Database module in spite of having to turn off the editor whenever editing the template, the same approach should work with the grid view type, although I haven't tried it yet myself. In the Entry template you enter the  broken html for the entry row. Now, whatever you have in the Entry template is generated for each entry and rendered via the ##entries## pattern. So to complete the table you add the html for opening and closing the table in the View template around the ##entries## pattern.

Give it a try, let me know if it worked and I'll add that to the documentation. úsměv

 

 

V odpovědi na Itamar Tzadok

Re: dataform for dummies - is not showing "views"

autor Willian Teodoro -

hi, Itamar!

My problem is in "View Template". "Entry Template" is fine! mrknout

I need to display each field dismembered of the ##entries## and repeat them below in the table, to get a similar result with this.

 

V odpovědi na Willian Teodoro

Re: dataform for dummies - is not showing "views"

autor Itamar Tzadok -

Not sure what you mean by "display each field dismembered of the ##entries##".

Here is a simple scenario for creating a horizontal table with the Grid view.

Given an activity with a text field 'Field Text' and a grid view with default templates, and editors turned off, do the following:

  • Replace in field "View template" "##entries##" with "<table id=\"custom-horizontal-table\" class=\"generaltable\"><theader><th>Author</th><th>Text</th><th></th></theader><tbody>##entries##</tbody></table>"
  •  Set the field "Entry template" to "<tr><td>EAU:name</td><td>Field Text</td><td>EAC:edit EAC:delete</td></tr>"

Note that the entry template html contains only a table row. The opening and closing table tags are added in the View template.

See also CONTRIB-5011, a minor fix for html validation when building such a view.

hth úsměv

V odpovědi na Itamar Tzadok

Re: dataform for dummies - is not showing "views"

autor Willian Teodoro -

Sorry, i'm doing something wrong?  Showed no nothing! mrzutost Thank you!

 

V odpovědi na Willian Teodoro

Re: dataform for dummies - is not showing "views"

autor Itamar Tzadok -

Remove back slashes. They are in the post only because the html is in a string.

<table id="custom-horizontal-table" class="generaltable"><theader><th>Author</th><th>Text</th><th></th></theader><tbody>##entries##</tbody></table>

And, field patterns should be enclosed in square brackets! (The forum editor removes these brackets so examples copied from here as is may not work) So, Field Text should be [[Field Text] ] (without the redundant space between the closing brackets) etc.

úsměv

 

V odpovědi na Itamar Tzadok

Re: dataform for dummies - is not showing "views"

autor Willian Teodoro -

Unfortunately, I tried again and also failed! :'-(

V odpovědi na Willian Teodoro

Re: dataform for dummies - is not showing "views"

autor Itamar Tzadok -

Post a screenshot of the templates content. úsměv

V odpovědi na Itamar Tzadok

Re: dataform for dummies - is not showing "views"

autor Willian Teodoro -
V odpovědi na Willian Teodoro

Re: dataform for dummies - is not showing "views"

autor Itamar Tzadok -

Yes, sorry, I checked again and the CONTRIB-5011 fix is in fact required for this to work. With a bit of luck it will be released later tonight. úsměv

V odpovědi na Itamar Tzadok

Re: dataform for dummies - is not showing "views"

autor Willian Teodoro -

THanks, Itamar!! 

The 2014041701 build is working fine!! mrknout 
---

Just one more question: 

I can change the "more" link to another "view"? 

Thank you very much!! 

V odpovědi na Willian Teodoro

Re: dataform for dummies - is not showing "views"

autor Itamar Tzadok -
[[EAC:more:viewname] ]

Replace viewname with the name of the designated view.

(Note: if you copy from here, remove redundant space between closing brackets)

hth úsměv

 

V odpovědi na Itamar Tzadok

Re: dataform for dummies - is not showing "views"

autor Willian Teodoro -

Hi, Itamar!

Is possible make this on the button? E.g. # #addnewentry:viewname# #

---

I take this opportunity to send my translation of Dataform for "Português BR" (90%).

 

Thank you! 

V odpovědi na Willian Teodoro

Re: dataform for dummies - is not showing "views"

autor Itamar Tzadok -

##viewlink:view-name;link-text;url-query;##

view-name: The name of view that is linked.

link-text: The text of the link. Could be html but ';' or any html special chars that would contain ';' if entered in editor mode, cannot be used.
A special link-text pattern allows for display theme icons, e.g. _pixicon:f/pdf:Download, _pixicon:i/edit:Edit etc.

url-query: Optional. Url query parameters that will be added to the view url in the link. These are arg=val pairs separated by |. The args should be expected by the target view to take effect. The vals can be entry patterns.

Example for displaying a linked icon that will open the entry in a view called Single:

##viewlink:Single;_pixicon:t/preview:Details;eids=[[entryid] ];##

 

Example for displaying a linked 'Add a new entry' text that will open a new entry form in a view called Single:

##viewlink:Single;Add a new entry;editentries=-1;##

 

If the target view is designated for adding new entries (that would be case if you replace the ##entries## pattern with ##newentry## pattern) it will always open on a new entry form (useful for contact form application) and you can use a simplified view link pattern without the url query:

##viewlink:Single;Add a new entry;;##

 

(Note the semicolons in the pattern. They are required).

 

Translations should be added via AMOS at http://lang.moodle.org/.

hth úsměv

 

V odpovědi na Itamar Tzadok

Re: dataform for dummies - is not showing "views"

autor Noah Freedman -

Just tried the ##viewlink:Single;Add a new entry;editentries=-1;##  Running 2.8.5

All went well with editing the new entry, until I clicked on "Save".  The view closed but the entry was not saved.  Activating debug showed the following.  Any ideas?

Notice: Trying to get property of non-object in /var/www/hlc/moodle/mod/dataform/classes/access/view_access.php on line 55

Notice: Trying to get property of non-object in /var/www/hlc/moodle/mod/dataform/classes/access/view_access.php on line 61

V odpovědi na Itamar Tzadok

Re: dataform for dummies - is not showing "views"

autor Lorenzo Prieto -

I have tried the form:

##viewlink:Single;_pixicon:t/preview:Details;eids=[[entryid] ];##

and it doen't work in moodle 2.8. From the moment I add the [[entryid] ] as a param, the pattern is no longer replaced by a link and it appear as is on the view.

V odpovědi na Lorenzo Prieto

Re: dataform for dummies - is not showing "views"

autor Jeff McCarthy -

Yes, I experienced the same thing in moodle 2.8.  Interestingly when I replace [[entryid] ] with an actual number, it works. So it is something about using that pattern within the param.