Pages: 1
Print
Author Topic: finding otherprops attributes  (Read 3449 times)
csmith
Member

Posts: 9


« on: October 14, 2009, 11:21:56 AM »

Is there a way to search on otherprops attribute values across all valid elements in a topic? I can do a search that specifies a specific element type, but I want to find them on any element type. Can I set up a search that uses a wildcard for the element type?
Logged
Su-Laine Yeo
Solutions Consultant
Member

Posts: 260


« Reply #1 on: October 14, 2009, 01:33:34 PM »

The one thing that comes to mind is using Plain Text View. If you are searching for an otherprops value of "foo":

1) Switch to Plain Text View.
2) Click Edit > Find and Replace.
3) Type otherprops="foo" in the Find field of the Find and Replace dialog box.

The limitation of this method is that if an element has more than one otherprops value, you might miss it. This method won't find elements that have, for example, "otherprops="bar foo".

Cheers,
Su-Laine
Logged

Su-Laine Yeo
Solutions Consultant
JustSystems Canada, Inc.
csmith
Member

Posts: 9


« Reply #2 on: October 14, 2009, 01:44:18 PM »

We are using XMetaL in a component CMS that does not support Plain Text View. Any other options?
Logged
Su-Laine Yeo
Solutions Consultant
Member

Posts: 260


« Reply #3 on: October 14, 2009, 02:37:44 PM »

You could use any word processor that has a Find feature, such as Notepad or Microsoft Word. If you select your whole document in XMetaL Tags On or Normal view, copy it, and then paste it into a third-party text editor, your document will paste with all attributes visible as plain text.

Be sure not to modify your document in third-party text editors though, because you won't be able to paste it all back into XMetaL without using Plain Text View.

Cheers,
Su-Laine

Logged

Su-Laine Yeo
Solutions Consultant
JustSystems Canada, Inc.
csmith
Member

Posts: 9


« Reply #4 on: October 14, 2009, 03:02:31 PM »

That is a very awkward workaround that would impact writer productivity. I would prefer having XMetaL enhanced so the search can be done inside the editor.

It would help to have elements with the the otherprops attribute set highlighted (like product, platform and audience attributes). That would help us find them faster.

We are a heavy user of filtering through our CMS and need efficient ways of managing filtering attributes. We use otherprops a lot.
Logged
Su-Laine Yeo
Solutions Consultant
Member

Posts: 260


« Reply #5 on: October 14, 2009, 04:08:08 PM »

Oh, I see! I'm very glad you've provided this background because styling elements according to their otherprops values is actually much easier than searching. You can do it by configuring the Conditional Text feature as follows:

1) In Notepad, open the ct_config.xml file from C:\Program Files\XMetaL 6.0\Author\Conditional Text\configs
2) Add the following code immediately before the </conditions> tag:

Code:
  <attribute name="otherprops" title="Whatever">
   <value name="foo" title="foo" />
   <value name="bar" title="bar" />
  </attribute>

3) Save the ct_config.xml file.
4) Restart XMetaL.

After doing the above, you will be able to use the Reuse > Style Conditional Text dialog to apply highlight colors or text colors to elements with the "foo" and "bar" otherprops values. You can also use the Reuse > Apply/Remove Conditions dialog box to apply your otherprops values.


Cheers,
Su-Laine
Logged

Su-Laine Yeo
Solutions Consultant
JustSystems Canada, Inc.
csmith
Member

Posts: 9


« Reply #6 on: October 14, 2009, 05:02:41 PM »

OK, we're making some progress.

I would like to highlight all elements with *any* otherprops attribute. We use about 20 different otherprops attribute values for filtering, and in many cases we use more than one value on an element. I don't want different highlighting for each case. Once we can visually identify where an otherprops attribute is set, we can look at the Attribute Inspector to see the values. 

I want this to work just like the highlighting works on the platform, product, and audience attributes--that is, the element is highlighted if *any* value has been set on these attributes.

I still would like to see this as a capability of the search in XMetaL. But this will help a lot.
Logged
Su-Laine Yeo
Solutions Consultant
Member

Posts: 260


« Reply #7 on: October 14, 2009, 05:54:24 PM »

Hi,

The Style Conditional Text dialog has the option you need. Once you've edited the ct_config.xml file to include values for the otherprops attribute, you can use the Style Conditional Text dialog to apply a default style for elements that have any value for otherprops. It works exactly the same way as styling conditional text for product, platform, and audience.

I'll also submit a feature request for searching by attribute value.

Cheers,
Su-Laine
Logged

Su-Laine Yeo
Solutions Consultant
JustSystems Canada, Inc.
csmith
Member

Posts: 9


« Reply #8 on: October 14, 2009, 05:57:31 PM »

Great! Thanks for your help. I have already edited the config files and it is working!
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 1548



WWW
« Reply #9 on: October 14, 2009, 06:24:42 PM »

The Find and Replace dialog allows you to find and replace attribute values in TagsOn and Normal view. You use the Element tab for this.

For instructions, open the Find and Replace dialog, select the Element tab and click on the Help button. I think this is fairly clearly documented. If something is not clear please ask so we can update the documentation.
Logged
csmith
Member

Posts: 9


« Reply #10 on: October 14, 2009, 06:28:36 PM »

I already tried the Find and Replace dialog. I can find all occurrences of a <p> element with a specified attribute name/value pair, but I want to find *any* element that has a specified attribute name/value pair. I was looking for a way to wildcard the element name.
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 1548



WWW
« Reply #11 on: October 14, 2009, 06:42:53 PM »

Sorry about that (I just re-read the original post, this is a long thread now).

So, no, there is no wildcard support for this particular feature. It would probably be possible to write a script that would allow that and wrap that script in an XFT form if some kind of GUI would be needed (ie: the values you need to find and replace would need to be modifiable by the author of the document and not fixed, which I assume is likely the case).

The idea of allowing wildcards for the element names (and perhaps attributes) in the existing Find and Replace dialog is an interesting one and we will think about that when we are looking at features to implement in the future.
« Last Edit: October 14, 2009, 06:44:24 PM by Derek Read » Logged
dcramer
Member

Posts: 120


« Reply #12 on: October 15, 2009, 09:03:17 AM »

The resource manager is another good place to implement that. You could have a little html form that asks for the element name or a wildcard and the attribute name and value, then find all occurrences and display the results in below the form in the resource manager. I do a similar thing where I give them a dropdown of certain elements (e.g. figures, procedures, tables with titles) and a Filter field. Then below the form display the titles of all the figures and let them filter the results by a regex in the filter field. Click on a result and you're taken to it.
Logged

David Cramer
Technical Writer
Motive, an Alcatel-Lucent Company
Pages: 1
Print
Jump to: