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,6 +269,10 @@ class XmlDescriptor(XModuleDescriptor): ...@@ -269,6 +269,10 @@ class XmlDescriptor(XModuleDescriptor):
if is_pointer_tag(xml_object): if is_pointer_tag(xml_object):
# new style: # new style:
# read the actual definition file--named using url_name.replace(':','/') # read the actual definition file--named using url_name.replace(':','/')
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)) filepath = cls._format_filepath(xml_object.tag, name_to_pathname(url_name))
definition_xml = cls.load_file(filepath, system.resources_fs, location) definition_xml = cls.load_file(filepath, system.resources_fs, location)
else: else:
......
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