atom theme images folder

49 views
Skip to first unread message

Ricardo Pinho

unread,
Apr 18, 2021, 4:42:10 PM4/18/21
to ica-ato...@googlegroups.com
Dear AtoM users,

The AtoM images are located in the default images folder (atom/images).

To use different images for an AtoM theme/plugin, is it possible to configure AtoM to look first for those images in a different folder (placed inside the theme/plugin directory) ?

If anyone knows a solution for this problem, could please explain or give me a clue on how to achieve this?

Thank you in advance!
Best regards,
--
Ricardo Pinho

José Raddaoui

unread,
Apr 19, 2021, 1:07:44 PM4/19/21
to AtoM Users
Hi Ricardo,

Yes, that should be possible, but it also requires to overwrite the templates in the plugin. See an example from the arArchivesCanadaPlugin:


Best regards,
Radda.

Ricardo Pinho

unread,
Apr 20, 2021, 10:59:38 AM4/20/21
to ica-ato...@googlegroups.com
Thank you José for the quick reply!

Yes I'm aware of that possibility, to manually and individually edit the php code to add the new image complete path, like the example you indicated:
<?php echo image_tag('/plugins/arArchivesCanadaPlugin/images/council.fr.png',

But I was looking for a more general and automatic solution.

To try to explain it better, let me exemplify with that same example (arArchivesCanadaPlugin) the use of several icons located at:
and

1st example:
Why are the "icons-large/icons-small specific images folders" not placed inside the arArchivesCanadaPlugin images folder?
For moving those icons-large/icons-small images inside the plugin images folder, what changes to the php code were necessary?

2nd example:
How can I replace an image of those generic-icons for one located inside the plugin images folder? (without changing the file inside the /atom/images/generic-icons and affect all the other themes)
And how can we do that without replicating and editing all the AtoM php code files to the plugin, with reference paths to that atom/images folder image?

Thank you in advance for all suggestions and tips.
Best regards,
Ricardo Pinho



--
You received this message because you are subscribed to the Google Groups "AtoM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ica-atom-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ica-atom-users/9f845ac5-4696-4037-8c32-271e0cadb8ddn%40googlegroups.com.


--
Ricardo Pinho

José Raddaoui

unread,
Apr 20, 2021, 11:42:21 AM4/20/21
to AtoM Users
Hi Ricardo,

Why are the "icons-large/icons-small specific images folders" not placed inside the arArchivesCanadaPlugin images folder?

Because they are used in other places outside the arArchivesCanadaPlugin, like ...

 
For moving those icons-large/icons-small images inside the plugin images folder, what changes to the php code were necessary?

Change all the image_tag() calls like the one linked above to point to the plugin path.

How can I replace an image of those generic-icons for one located inside the plugin images folder? (without changing the file inside the /atom/images/generic-icons and affect all the other themes)

For the above example you would overwrite the entire "modules/informationobject/templates/browseSuccess.php" template within the new theme, just to change the image_tag() call path for the one from the plugin.

And how can we do that without replicating and editing all the AtoM php code files to the plugin, with reference paths to that atom/images folder image?

I initially thought you couldn't configure the default images path, but it looks like there is a config setting ...


I'd try to ...

- Copy all the images from the main images folder to the one in your plugin and replace the ones you want.
- Modify the config value in the theme plugin configuration class, initialize method (arArchivesCanadaPlugin example):

sfConfig::set('sf_web_images_dir_name', 'plugins/yourThemePlugin/images');

However, that will only work with a few images, and it looks like it won't work with the icons you're trying to replace because their path is set as an "absolute" path (starting with "/"). Therefore, I think it's not possible at the moment without overwriting the templates in the plugin or modifying the vanilla code.

I have not tested any of this so, if you would like to check it and verify that it works as expected, and you are up to modify those image paths and submit a PR to modify them in the public version, it would be really appreciated and helpful for other themes.

Best regards,
Radda.

Ricardo Pinho

unread,
Apr 20, 2021, 2:39:15 PM4/20/21
to ica-ato...@googlegroups.com
Thank you very much José!
I will test your interesting suggestions and if I find some way to make it work I will share it here and at github, as always... (if suitable I can also submit a PR).

If you don't mind, allow me to make one more question... ;-)

To my understanding,
the AtoM (Symfony) plugin/theme functionality, is based on:
Use and execute existing php files located in "atom/plugins/yourThemePlugin" folder,
instead of php files located in the "atom/apps/qubit" folder.

For example:
When you activate arArchivesCanadaPlugin
AtoM uses/runs:
/atom/plugins/arArchivesCanadaPlugin/templates/_header.php
instead of:
/atom/apps/qubit/templates/_header.php

Not quite sure if this makes any sense, but:

Could it be possible?
to use/configure somehow this SF functionality for
AtoM prefer to use images in (if they exist):
atom/plugins/yourThemePlugin/images
instead of images in:
/atom/images


Thank you.
Ricardo Pinho


--
You received this message because you are subscribed to the Google Groups "AtoM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ica-atom-user...@googlegroups.com.


--
Ricardo Pinho

José Raddaoui

unread,
Apr 20, 2021, 2:57:34 PM4/20/21
to AtoM Users
Hi Ricardo,

I just discovered this config setting but it looks like it's only used in the image_tag helper (and a related test) in the entire AtoM source code, so I'd say such functionally doesn't exists in Symfony 1.4. It should be possible to implement such logic in that helper, checking the image existence in the plugin and falling back to the main folder, but I'm not sure that's something we'll want in the public version as it would modify the Symfony framework code.

I know it's not ideal and will require further maintenance but, if all the image_tag calls that use "/images/what/ever.png" are fixed to use "what/ever", duplicating the images in the theme should be enough.

Best.
Reply all
Reply to author
Forward
0 new messages