Adding File Dimensions to a Custom Template

Started by Damit, October 31, 2022, 05:57:42 PM

Previous topic - Next topic

Damit

I am getting deeper and deeper into the functions of this program during my trail. I am really impressed with the degree of customization, but there is a rather large learning curve, especially for those with no programming background. Things can be quite dense.

Anyhow, I am having trouble figuring out add the attribute File.Dimension to a custom template.  I used {File.Dimension} & {File.Dimensions} but neither of them worked.

I am trying to create {File.Size}<LineBreak/>{File.Dimensions}
but I am not sure what attribute or metadata will give me the desired result.

Any help would be greatly appreciated.

Mario

#1
There is no variable named {File.Dimensions}.
See Variables for a list of all valid variables.

With "custom template" I assume you mean a custom template in a File Window layout?
If so, clicking the ... button will open the Variables Selector Dialog where you can select from all variables:

Image2.jpg

For your purpose, probably the two variables {File.Width} x {File.Height} will do the job.

Tip:  The VarToy app (in the App Manager) allows you to select and try out variables interactively.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Damit

#2
Yes, I am dealing with the File Window layout.
Quote from: Mario on October 31, 2022, 06:11:17 PMThere is no variable named {File.Dimensions}.
I have used the variable selector and tried to use the VarToy app (Love this BTW) to figure this out, but could not find dimensions, even though it is in the list of attributes, which is why I was confused. I tried all sorts of metadata, and nothing worked. Your suggestion, of course, worked!! Thank you so much!

I am now trying to get {File.Size} <LineBreak/>{File.Width} x {File.Height} to justify to the right.  Even though I have alignment set to right, it seems they are aligning to the left, as the file size is aligned to the left. Uness the alignment is grouped amount the two terms.  Even so, there must be a way to unlink the alignment of the 2 variables. I assume I need to use XAML to do this but cannot figure out how.

Mario

The standard File Window attribute names are not directly related to variables. They are designed to cover 95% of what most users will ever need.

For the other 5% of the user base, custom templates and variables are available, which allow to do amazing things. But this is considered an advanced user feature, so expect to spend some time with experimenting.

The alignment option is applied to the entire template. When I use your variable and set the template to align right, it works.
But using <LineBreak/> with markup and alignments is always a bit tricky. I would not recommend it. Use a StackPanel with two TextBlocks instead:

<StackPanel VerticalAlignment="Top" HorizontalAlignment="Right">
  <TextBlock>{File.Size}</TextBlock>
  <TextBlock>{File.Width} x {File.Height}</TextBlock>
</StackPanel>

See Formatting Output with XAML for more information and examples.

Note: You can get the same result by using two footers (or headers), one for Size and the second for Dimensions.

-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Damit

Of course, I fall into the 5% ;D

I used the Stack Panel and I believe the file size is adding a pad due to the file dimension text size, which makes it look like they are aligned to the left. It looks like this:

123.56 MB
5,221 x 4,135

Where I want it to look like:
   
    123.56 MB
5,221 X 4,135

Perhaps this cannot be accomplished this way?

Also, if I like a layout of all the panels, can I save the TOTAL layout, where the panels in the left (Media & Folders, Categories, etc), the panels in the center (File window), and the panels on the right (Metadata, Keywords, etc) can be saved as they are, especially in sizing, so they can be recalled?

I am working on a full screen and half-screen layout and would like to be able to recall all the panel settings and sizing at once. 

Lastly, for the custom File Window Layouts, is it possible to define headers in such a way that the space they occupy will not appear if they are not present?  For example, I have set a large size for keywords, but if there are no keywords I would not like to see a large blank space. If not, can you make the size expandable, so it only occupies the amount of space needed?

Mario

Quote from: Damit on October 31, 2022, 07:39:25 PMAlso, if I like a layout of all the panels, can I save the TOTAL layout, where the panels in the left (Media & Folders, Categories, etc), the panels in the center (File window), and the panels on the right (Metadata, Keywords, etc) can be saved as they are, especially in sizing, so they can be recalled?
Loading and Saving Workspaces?

Quoteis it possible to define headers in such a way that the space they occupy will not appear if they are not present? 
No. If you don't specify a size, headers/footers use a minimum height. File Windows must be capable of displaying hundreds of thousands of files, so everything is designed to be fast.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook