Gossamer Forum
Home : Products : DBMan : Installation :

check duplicate...if "Title" working, then "ID" is not working...

Quote Reply
check duplicate...if "Title" working, then "ID" is not working...
Hi All:

Is possible let "Title" and "ID" both working the for check duplicate.


Thanks JPDeni help me for the check duplicate function, and it works.
--------------------------------------------
Look in the default.cfg file. Just below where you define the fields, there is a line

$db_key =

If the field that you don't want duplicated is called "Title", change the line so that it reads

$db_key = 'Title';

A little further down there is a line that says

$db_key_track = 1;

Change that line so it reads

$db_key_track = 0;

------------------
But I also use short display mod, so I have to use "ID" for my $db_key. Is any other way to check duplicate the title without use $db_key for "ID" and disable $db_key_track?

Quote Reply
Re: check duplicate...if "Title" working, then "ID" is not working... In reply to
You don't have to use "ID" with the short display mod.

In your link to the full display, use

$db_key=$rec{$db_key}

You might need to consider that there will be spaces in your title, though, which can cause some problems with the URL. Before you print out the link to the full display, add a line

$rec{'Title'} =~ s/ /+/g;

That will replace all of the spaces in your title with plus signs and make the URL work. Be sure that you end off any previous print qq| statement before you use this line, though.


------------------
JPD