Closed (outdated)
Project:
Examples for Developers
Version:
8.x-1.x-dev
Component:
Other
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
2 Oct 2013 at 04:16 UTC
Updated:
1 May 2020 at 18:36 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
djevans commentedI'll take this :)
One thing I can see to change for D8 will be to use the EasyRdf library for testing.
Comment #2
djevans commentedHere's my first attempt at an example module. I've tried to port the D7 version of this module as faithfully as possible.
Like the D7 version, this module creates a custom node type with two fields, and defines an RDF mapping for it. This is all done with YAML config files.
The module also does something the D7 version claims to, but doesn't - modify the mappings for an existing node type. The 'RDFa modification' test case uses the Configuration API to modify the mappings of the 'article' node type from the standard installation profile. As this happens inside a test rather than as part of an install hook, it avoids overwriting any active configuration.
I'd welcome any comments on the 'correctness' of this example and any suggestions on how/if you think the explanations can be made clearer.
Comment #3
mile23Thanks, djevans! Looks good. Just some things...
Some #comments for these config yml files would help the newbie find their way through them.
This is a good start, but if there's a way for the user to see what's been done, provide instructions for how to do that. I think in this case it's just view source and find the mappings, right?
I suppose it's easier to demo the mapping modification this way, but it would be great if the user could look at the modified mappings, by viewing source or through whatever means. They can't do this in a test.
+1 on talking about changes since D7.
Doesn't have a menu_links.yml file, but I made one. In the attached patch.
Comment #5
djevans commentedThanks for the patch, Mile23!
Regarding modifying the mappings for the Article node type, I was trying to avoid the case where someone enables the module on an actual development site and ends up (unintentionally) clobbering existing RDF mappings. I'd also say the test has the benefit of verifying that the RDF is different before and after the config changes.
For the custom node type, at least , how about using a combination of hook_node_view() and EasyRdf_Graph::dump()?
Comment #6
mile23Generally unassigning issues. Please re-assign yourself as desired.
Comment #7
kristen polObviously this never happened... closing this almost 7 years later o_O