Commit d1f96eeb by Arjun Singh

Allow filename and url_name to be different. This is useful when you want to…

Allow filename and url_name to be different. This is useful when you want to reuse some components, but not everything. You can make a new file for just the bit that needs to be different, but keep the same URL structure.
parent 40b5e54d
......@@ -269,7 +269,11 @@ class XmlDescriptor(XModuleDescriptor):
if is_pointer_tag(xml_object):
# new style:
# read the actual definition file--named using url_name.replace(':','/')
filepath = cls._format_filepath(xml_object.tag, name_to_pathname(url_name))
filename = xml_object.get('filename')
if filename:
filepath = cls._format_filepath(xml_object.tag, filename)
else:
filepath = cls._format_filepath(xml_object.tag, name_to_pathname(url_name))
definition_xml = cls.load_file(filepath, system.resources_fs, location)
else:
definition_xml = xml_object # this is just a pointer, not the real definition content
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment