First thing you will need to do, if you haven't already, is unpack the game so you have access to the files you need to edit.
It sounds like you're trying to make the Knights Templar unit available to the Portugal faction in the vanilla grand campaign. To do this, open export_descr_units with a suitable text editor (Notepad++, Programmer's Notepad, etc., don't use regular Notepad if you have that installed on Linux for some reason), and find the Knights Templar entry. On the 'ownership' line, add portugal to the list.
Code:
ownership england, scotland, france, denmark, milan, venice, papal_states, sicily, poland, hungary, portugal
Then, looking at the line, armour_ug_models, we see that the unit has two visual appearances: Knights_Templar and Knights_Templar_ug1. We also check if the unit has any officers and we see that it does not. Now we need to search for these entries in battle_models.modeldb and add texture references for portugal so the unit won't look like silver surfers for Portugal. It will be easier to edit this file if you use the formatted version.
Add texture references for the body and attachments sections for both entries, remember to increment the number of entries in all sections by +1. It looks like this unit uses different textures for different factions (which is not uncommon in vanilla). I have simply used Sicily's textures for Portugal here. If you want to make your own Portugal textures for this unit, you will need Modeler's Toolbox to convert .dds to .texture and a suitable image editor such as Gimp or Photoshop, but that is the subject of a whole tutorial. For now, we'll just use Sicily's textures.
We also need to add UI (cards and info images) for portugal for this unit. This is linked using the dictionary name in export_descr_units: Knights_Templar. Searching this in the unpacked ui/unit_info and ui/units folders gives the files knights_templar_info.tga (info image) and #knights_templar.tga (card). Again, I would just take the images from sicily's folders for now and copy/paste them into portugal's folders so you don't get the Roman peasant.
Now we need to make the unit trainable from the guild for portugal, so open export_descr_buildings.txt and search for all instances of "Knights Templar" (the unit type name from export_descr_units). There should only be 3, all in the guild_templars_chapter_house building. We need to portugal as a required faction for all three lines:
Code:
recruit_pool "Knights Templar" 1 0.4 3 0 requires factions { england, scotland, france, denmark, milan, venice, papal_states, sicily, poland, hungary, portugal, }
We can also add portugal to the required factions for the guild building itself, but since it's a guild, I'm not sure this is necessary - but probably good to do anyway. Again, do this for all three levels of the guild:
Code:
templars_minor_ch requires factions { england, france, scotland, denmark, hungary, poland, papal_states, milan, sicily, venice, portugal, }
The southern_european culture should already have UI set up for the chapter house building so you probably don't need to worry about that.
So far, we've done all the steps normally required for unlocking a unit (and building) for another faction. Now all that's left is setting up the guild. Open export_descr_guilds.txt and search for the building name from export_descr_buildings: guild_templars_chapter_house. We see that this building entry is being used by the guild type: templars_chapter_house. Searching this in the rest of the file shows that there are no faction, culture, or religion specific triggers for adding guild points, so portugal should already be able to get this guild and you should be good to go.