DappHero Docs
  • Getting Started 👋🏽
  • DappHero Basics
    • How does it work? 🧐
    • Setting Up Your Project 🏗️
      • Projects
      • Smart Contracts
    • An Intro to Features 🎁
  • Features
    • Network ⛓️
    • User 🤖
    • 3box 👯‍♂️
    • Smart Contracts 👩🏾‍🔬
      • Adding Smart Contracts 🏗️
        • Contract Details
      • Create a Method Instance
      • Inputs
      • Invoke
      • Outputs
      • Events
      • Advanced: Automatically clearing Inputs
      • Advanced: Getting the Current User's Address Dynamically
      • Advanced: Sending ETH to a contract method
      • Listening to Events
      • Resources: Learn More
      • Resources: Test Contracts
    • Collectibles 🃏
      • Getting Started
      • Single Collectibles
      • Listing Collectibles
      • Displaying Token Metadata
      • Advanced: $CURRENT_USER
      • Advanced: $URL
      • Advanced: $THIS
      • Advanced: Properties
      • Calling Smart Contracts inside Collectibles
      • Collectible Example
  • No-Code Integrations
    • Webflow 🎁
      • Getting Started with Webflow
      • Add DappHero Elements
      • Learn more about WebFlow
  • Examples
    • Coming soon...
  • Advanced
    • Engine Events
    • Force Refresh
    • Database
    • Ethereum Provider
  • Updates
    • ChangeLog
  • Bug Bounty
Powered by GitBook
On this page

Was this helpful?

  1. Features
  2. Collectibles 🃏

Advanced: $CURRENT_USER

Dynamically getting the address of the current user

In situations where it doesn't make sense to hard-code the address of the user for which you would like to retrieve a Collectible or list of Collectibles, the special constant $CURRENT_USER can be used to dynamically insert the current users address.

This constant can be used to help create dynamic websites with Collectibles.

<div
    data-dh-feature="nft"
    data-dh-property-tag-id="<<UniqueID>>"
    data-dh-property-asset-token-id="<<TokenID>>"
    data-dh-property-asset-owner-address="$CURRENT_USER">
    
    <div 
        data-dh-property-tag-id="<<UniqueID>>" 
        data-dh-property-asset-item="true">
        
        <img data-dh-property-asset-json-path="image_url" />
        <h3 data-dh-property-asset-json-path="name"></h3>
    </div>
</div>
PreviousDisplaying Token MetadataNextAdvanced: $URL

Last updated 5 years ago

Was this helpful?