Developer forum

Forum » Feature requests » @Include improvement

@Include improvement


Reply
Hi,

I would like to give the @include tag a lot more use but for that the priority in processing it has to be slightly changed.

I tried to introduce a series of If Defined tag in an included file and none of them work. Would be great if the Included file's tags were processed like if they made a part of that file.

The problem is that we developed a module and have a search form + results part for a webservice integration. It so happens that this webservice has over 10 different search forms. Since a lot of the fields are the same (like date, destination, num adults) I was trying to have one file full of if defined tags to provide validation, instead of having to copy that 6 or 7 times over.

Nuno

Replies

 
Nicolai Høeg Pedersen
Reply
I do not understand...

Includes are processed as the first thing when loading the template and are interpreted as if all of it is inside the original template - so you can easily have if defined inside your includes.


 
Reply
Hi Nicolai,

That's weird, because it's not working :S I will post it as bug

Thanks,
Nuno

 
Nicolai Høeg Pedersen
Reply
I'm pretty sure there is no bug...

Could you attach a copy of the template and includes here?
 
Reply
Hi Nicolai,

In attachment you can see the files. in the SearchHotel.html I have included the other file. I know the included tag works because when of the alert in that file.

I tried including a js file, and html file, but none seem to work

Thanks,
Nuno

 
Nicolai Høeg Pedersen
Reply
That was a lot of if defineds... You might want to use JS to check if the fields are their instead of if defined.

That said, does the if defined work when used directly in SearchHotel.html?

What does the DwTemplateTags return when inserted in SearchHotel.html?
 
Reply
Hi Nicolai,

Everything works fine if within the SearchHotel.html file. When you place them in another file through the @Include tag, that's when it stops working, that's why I say it's a bug (according to you).

We are using that much If Defined's to work in all search forms we have to develop (around 15) and have as little client-side processing (javascript) as possible.

Nuno
 
Nicolai Høeg Pedersen
Reply
If we could have a link it would make it easier to locate the problem.

Could you mail me the URL?
 
Reply
Hi Nicolai,

i didn't yet (nor opened a case) because it's on a local server with the developer. It will become available in a few days. I will post it then.

Nuno